| Posted by Peter revera on 01/11/07 15:23 
On Thu, 11 Jan 2007 15:11:37 +0000, Geoff Berrow<blthecat@ckdog.co.uk> wrote:
 
 >Message-ID: <g6kcq211hinohaqm5kls2qve4ki50duab6@4ax.com> from Peter
 >revera contained the following:
 >
 >>$get = "SELECT * FROM categories";
 >>$answer = mysql_query($get)
 >>or die ("Couldn't execute query.");
 >>
 >>	echo "<select name=listid' class='gradientform'>\n";
 >>	while ($row = mysql_fetch_array($answer))
 >>  	{
 >>    extract($row);
 >>    echo "<option value='$itemid'>$item\n";
 >>  	}
 >>  	echo "</select>\n";
 >
 >$get = "SELECT * FROM categories";
 >$answer = mysql_query($get)
 >or die ("Couldn't execute query.");
 >
 >	echo "<select name=listid' class='gradientform'>\n";
 >	while ($row = mysql_fetch_array($answer))
 >  	{
 >	extract($row);
 >
 >	$selected=(isset($_GET['listid']) &&$_GET['listid']==$itemid)?"
 >selected":"";
 >    echo "<option value='$itemid'$selected>$item</option>\n";
 >  	}
 >  	echo "</select>\n";
 
 
 Ive added the code and when I view the form with the variable pased in
 the url the select list hasnt changed. It just defaults to the normal
 order.
 [Back to original message] |