Gary,
Thanks for your quick help....
Yea what I am trying to do is put all the cities for each state into a variable...I am going to try to explain what I want my code to do in play english
=]
It needs to grab all 50 states from the DB then for each state it needs to look in the database for records where the state field matches that state and then take the city field from that record and put it in a variable...
I changed my code around a little bit getting the code for the variable variable right this time I think...here it is:
$statelist = mysql_query("SELECT DISTINCT state FROM cities ORDER BY 'state'");
$result = mysql_query("SELECT * FROM cities ORDER BY 'city'");
$row = mysql_fetch_array($result);
while ( $staterow = mysql_fetch_array($statelist) )
{
$current_state = $staterow["state"];
while ($row["state"] == $current_state )
$$current_state .= "{$row["city"]} ";
}
Thanks again for all your help!