Hi all:
I've been trying to get this thing done for a while now without much success!
I'm using the code below to populate a selction box with States. It works fine.
What I need is to get the appropriate item selected.
On the page prior to this, users have already logged in and there's a State column for the users. So all I need is to get the user's state pre-selected. ie if user is from California, California gets selected.
The snippet is pasted below.
Thanx in advance........
Kamy
{
include_once "common.inc";
$CountryCode = "US";
$result = mysql_query("select * from provinces where CY='$CountryCode'");
while ($query_data = mysql_fetch_row($result))
{
echo "<option Value=",$query_data[2]," >",$query_data[1],"</option>";
}