Re: always last

From: Date: Thu, 23 Aug 2001 21:53:11 +0000
Subject: Re: always last
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64184@lists.php.net to get a copy of this message
On 23 Aug 01, at 11:10, Jeremy Morano wrote: > $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); > > > while ($row = mysql_fetch_array($result)) { > $uid = $row['uid'] > $team = $row['team']; if ($uid == $row['uid']) { $option_block .= "<option value=\"$uid\" selected>$team</option>"; } else { > $option_block .= "<option value=\"$uid\">$team</option>"; } > $option_block .= "<option value=\"$uid\">$team</option>"; > } [etc] Basically, you need to see if the value they selected is the one you're currently working with and add the 'selected' attribute to your <option> tag. If it's not then just keep on going through. CYA, Dave ----------------------------------------------------------------------- Outback Queensland Internet - Longreach, Outback Queensland - Australia http://www.outbackqld.net.au mailto:dfreeman@outbackqld.net.au -----------------------------------------------------------------------

« previous php.general (#64184) next »