I did read your message, I am still new to php.
I changed my code, and the list is still not picking the correct name from the list, it remains at Please Select...
Here is all the code I use;
function forecaster_Edit_Player() {
global $db;
showheader();
$id = $_GET['id'];
$row = $db->sql_fetchrow($db->sql_query("SELECT * FROM players WHERE id='$id'",false,__FILE__,__LINE__));
echo open_form(adminlink(),'post', 0,' style="border:none"');
echo '<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Player Name</td>
<td><input name="player_name" type="text" id="player_name" value="'.$row['name'].'"></td>
</tr>';
teamlist();
nationlist();
echo '</table>
<br /><br />
<input type="submit" value="Update Player">
<input type="hidden" name="edit_id" value="'.$row['id'].'">
<input type="hidden" name="mode" value="Save_Player" />
</form>';
showfooter();
}
and the nationlist is;
function nationlist () {
global $db;
echo '<tr>
<td>Nation</td>';
$nationlist = $db->sql_query("SELECT id,name FROM teams WHERE league =1 ORDER BY name");
echo "<td><select name=\"nation\"><option value=\"0\">Please Select...</option>\n";
while (list($nation_id, $nation_name) = $db->sql_fetchrow($nationlist)) {
if(isset($_GET) && !empty($_GET['nation']))
{
$sel = ($_GET['nation'] == $nation_id)?'selected':'';
} else {
$sel = ($nation_id==$nation_name) ? 'selected' : '';
}
echo "<option $sel value=\"$nation_id\">$nation_name</option>\n";
}
echo '</select></td>
</tr>';
}
Thanks again for your time.