Hey all,
I have a database of schools in the United States for my website to utilize. I am incorporating a search into my website that allows a teacher to choose a state, and from that a list of cities will appear.
The way my database is organized is as follows, I have the following columns:
school_name, school_address, school_city, school_state, school_zip.
Now, since there is obviously more than one school per city, I can't simply use
$query="SELECT school_city FROM schools WHERE school_state = '$state' LIMIT 0, 500";
$result=mysql_query($query);
$numrows=mysql_num_rows($result);
for($x=0; $x<$numrows; $x++)
{
$school_city = mysql_result($result, $x, "school_city");
}
to list the results...I need to purge all the results of duplicates.
How would I go about doing this?
Thanks in advance!
-influx