I am trying to use a dropdown menu to retrieve data but unable to do so.
Codes as follow. Please Help..
<form name="form1" action="result.php" method="post">
<select name="dropdownbox">
<?php
include("connectdb.php");
$city=mysql_query("select * from city");
while ($result=mysql_fetch_array($city))
{
echo "<option>{$result["Cityname"]}</option>";
echo "<br>";
}
?>
</select>
<?php
echo "<input type='submit' name='Submit' value='Search'>";
echo "<br>";
?>
</form>
Result.php
<?php
$city=$_POST["dropdownbox"];
include("connectdb.php");
$result=mysql_query("select * from ShopInfo, District, City where ShopInfo.ShopDistrict=District.DistrictID and ShopInfo.ShopCity=City.CityID");
while ($row=mysql_fetch_array($result))
{
echo $row["ShopName"]."<br>";
echo $row[$city]."<br>";
echo $row["DistrictChi"]."<br>";
echo $row["ShopAddress"]."<br>";
echo $row["ShopTel"]."<br>";
}
mysql_close
?>