I'm using the contents of a table to print an option list in another form to
allow me to cross reference the tables in my data.

<? $result = mysql_query("SELECT * FROM category",$db);
printf("<select name=\"catcode\">\n");
while ($myrow = mysql_fetch_array($result)) {
printf("<option value=\"%s\">%s</option>\n", $myrow["catcode"],

Once i have selected from the drop box the variable is submitted back to my
table and saved. 

When re-edit the data - the record already has a value for catcode which i
want to reflect within the drop box - in html it would be the addition of
selected="selected" within the <option>.

Are there any recommended methods of doing this?
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email       >> [EMAIL PROTECTED]
Web         >> http://www.brightstorm.co.uk
Tel         >> 0117 9426653 (office)
               07939 252144 (mobile)

Snailmail   >> Unit 8, 14 King Square,
               Bristol BS2 8JJ

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to