从select标记生成PHP结果

I am struggling to produce a SQL result. I am trying to display my results in a table from one of the select options.

Any help?

HTML:

        <form action="" method="post" name="parkname">  
                <select id="combobox" name="parkname" class="park-choice">
                <option hidden value="C">C</option>
                <option class="hidden" value="E">E</option>
                <option class="hidden" value="W">W</option>
                </select>
                <span style="display:inline-block; width: 200px;"></span>
                Capacity:
                <select id="foo" style="display:inline-block; width: 80px;" id="combobox">
                <input type="submit" value="submit">
                </select>
                </form>

PHP code:

                    <?php 
                    $selectOption = $_POST['parkname'];
                    $query = "SELECT * FROM `ROOMS` WHERE `Park` = '$selectOption%';"; 
                    $result = mysql_query($query);
                    echo $result;
                    if ($result == FALSE) die ("could not execute statement $query<br />");

                    echo "<table>"; 
                    while($row = mysql_fetch_array($result)){   
                    echo "<tr><td>" . $row['roomCode'] . "</td><td>" . $row['Park'] . "</td><td>" . $row['Capacity'] . "</td><td>" . $row['Style'] . "</td><td>" . $row['dataProjector'] . "</td><td>" . $row['Whiteboard'] . "</td><td>" . $row['OHP'] . "</td><td>" . $row['wheelchairAccess'] . "</td><td>" . $row['lectureCapture'] . "</td></tr>";
                    }

                    echo "</table>"; 

                    mysql_close(); 
?>

First, you need to clear your query from % sign.

$query = "SELECT * FROM `ROOMS` WHERE `Park` = '$selectOption';"; 

Or if you want to find all matches, you can use LIKE operator:

$query = "SELECT * FROM `ROOMS` WHERE `Park` LIKE '%$selectOption%';"; 

Second, for displaying html combobox with Park names (in your case), use code like:

 <select name="park">
  <option value="Park1">Display name</option>
  <option value="Park2">Display name</option>
  <option value="Park3">Display name</option>
</select> 

Park1,Park2,Park3 - Values that would be sent to your php code inside $_REQUEST['park'] variable.

Display name - Just visually display name for options in select