selected value from database
| From: | Peter Gumbrell | Date: | Fri, 18 Apr 2003 22:34:45 +0000 |
| Subject: | selected value from database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27172@lists.php.net to get a copy of this message | ||
In an update form, I have a select list with only 3 values: admin, author and contributor. How do I have the value currently held in the database be the one which is selected? Here is the code that I have so far;
print "<td> Level: <select name=\"level\" value=\"$level\"><option value=\"admin\">Admin</option>\n";
print "<option value=\"author\">Author</option><option value=\"contributor\">Contributor</option></select></td></tr>\n";
As you can see, the value taken from the database is $level.
Many thanks,
Peter Gumbrell
peter@orillia.net