如何创建一个只显示基于所选三个选项之一(C / E / W)的选项的SQL语句。目前,它只显示每一个结果。
另外,我如何做到这一点,一旦选择了C / E / W而不需要提交按钮,结果会降到下面?
任何帮助都将不胜感激。
<select id="combobox">
<option value="Central" id="C">C</option>
<option value="East" id="E">E</option>
<option value="West" id="W">W</option>
</select>
</p>
</div>
<div>
<?php
$query = "SELECT * FROM ROOMS";
$result = mysql_query($query);
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();
?>