Jer
10-20-2010, 12:12 AM
$userdata = mysql_query("SELECT * FROM user_data WHERE id='$id'");
$row = mysql_fetch_array($userdata);
$timezone=$row['time_zone'];
That pulls an int to relate to my timezone table.
print "<select name='' style='width: 157px'>";
$sql = mysql_query("SELECT * FROM timezone");
while ($row = mysql_fetch_array($sql)) {
print "<option value={$row['timezone_id']}>{row['timezone_name']}</option>";
}
print "</select>";
I have no errors and the list populates correctly.
What I want it to do is show the option as the original value in the <select> coding. So if my user has record 24 which is EST+5GMT that is what option is shown already selected in that box. This is for an edit page of a user profile.
Apologies I'm trying to do this on a phone since I'm at work.
$row = mysql_fetch_array($userdata);
$timezone=$row['time_zone'];
That pulls an int to relate to my timezone table.
print "<select name='' style='width: 157px'>";
$sql = mysql_query("SELECT * FROM timezone");
while ($row = mysql_fetch_array($sql)) {
print "<option value={$row['timezone_id']}>{row['timezone_name']}</option>";
}
print "</select>";
I have no errors and the list populates correctly.
What I want it to do is show the option as the original value in the <select> coding. So if my user has record 24 which is EST+5GMT that is what option is shown already selected in that box. This is for an edit page of a user profile.
Apologies I'm trying to do this on a phone since I'm at work.