我编写了一个HTML表单,用于在下拉窗口中显示由PHP脚本提取的MYSQL TABLE中的数据。
我的问题是它显示我在HTML表单OPTION中定义为ALL的值,但它不通过PHP脚本显示数据。请帮忙
我的代码如下: -
<form name='frmSearch' action='' method='post'>
<label>Design Category</label>
<select name="dlocation">
<option value="">All</option>
<?php
$connection=mysql_connect('localhost','root','password','dz');
$sql = "SELECT * FROM DEGSUBMIT GROUP BY dlocation ORDER BY dlocation";
$sql_result = mysql_query ($sql, $connection );
while ($row = mysql_fetch_assoc($sql_result)) {
echo "<option value='".$row["dlocation"]."'".($row["dlocation"]==$_REQUEST["dlocation"] ? " selected" : "").">".$row["dlocation"]."</option>";
}
?>
</select>
</form>