Forum Moderators: coopster
Then I built a DD box to select a city name
But it could be many times the same city name in that col
So for ex: if I have in that table 3 times AAA
How could I only grab a unique city name and not echo it three times in the DD box
if I write some useless procedure I will probably get it
but it got to be a simple way
of course LIMIT 1 is not an option (we need all cities)
<<<<<<<<<<<
print <<< FORM
<p><form action="search.php" method="post">
<label for="wide_search">Select a CITY to review aaaa.</label></p>
FORM;
$conn=db_connect();
$query = "select city from zxzxzx where state ='$state' ORDER by city ASC";
$result= mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
echo '<select name="wide_search">';
while ($i <$num)
{
echo '<option>';
$wide_search=mysql_result($result,$i,"city");
echo"$wide_search";
$i++;
}
print <<< CITY
<p>
<input type="submit" value="Select a City" /></form>
</p>
CITY;
>>>>>>>>>>>>>>>
$query = "SELECT DISTINCT `city` FROM zxzxzx WHERE `state` = '".mysql_real_escape_string($state)."' ORDER BY `city` ASC";
Glad it turned out to be an easy fix! ;)