
December 8th, 1999, 02:23 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I am putting together a database that includes states and cities... Each state has multiple listings in my database and also, each city has multiple listings in my database... When I call for a list of cities, I only want the cities to appear once, not multiple times... how do I do this... here is part of my script... I am really new at this so please forgive me if it is a really easy answer...
Thank you...
$result = mysql_query("SELECT * FROM $state",$db);
if ($myrow = mysql_fetch_array($result)) {
?>
<form method="post" action="cities.php3">
<p>
<select name="state"><?php
printf("<option selected>
$staten");?>
</select>
<select name="cities">
<option selected>Select a City</option><?php
do {
printf("<option>%sn", $myrow["City"]);
} while ($myrow = mysql_fetch_array($result));
echo "n";
?>
</select>
|