The client wants users to select and return "events" data (venue.name, event.eventdate, event.eventtime, venue.address, etc.) from a single city. I set up a list box and pulled the cities from my venue table. But since I have multiple venues in some cities I get every instance of that city listed.
I'm not sure if I need to remove venueid from the code or if I need to reconfigure my database structure with a city table.
I'm confused so any help would be appreciated.
Thanks!
Code:
<?php
...
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query = "SELECT venue.venueid, venue.city FROM venue ORDER BY city";
$result = mysql_query($query);
$options="";
while ($row = mysql_fetch_array($result)) {
$id = $row["venueid"];
$city = $row["city"];
$options.="<OPTION VALUE=\"$id\">".$city.'</OPTION>';
}
?>
Find a meeting in my city:
<select name=city>
<option value = 0>Choose
<?=$options?>
</select> </td>
<td colspan="3"> </td>
</tr>
<tr align="center" valign="middle">
<td height="2" colspan="6"> </td>
</tr>
</table>
I'm not sure if I need to remove venueid from the code or if I need to reconfigure my database structure with a city table.
I'm confused so any help would be appreciated.
Thanks!