RE: [PHP-DB] Problem with select-tag within a php-script
| From: | Snijders, Mark | Date: | Wed, 02 Jul 2003 13:54:12 +0000 |
| Subject: | RE: [PHP-DB] Problem with select-tag within a php-script | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-29024@lists.php.net to get a copy of this message | ||
the select has to be a name and not the id
the id has to be within the option value!
-----Original Message-----
From: Ruprecht Helms [mailto:rhelms@mayn.de]
Sent: woensdag 2 juli 2003 15:51
To: php-db@lists.php.net
Subject: [PHP-DB] Problem with select-tag within a php-script
Hi,
I've some trouble with a select-tag in a php-script.
In a database should be written the ID of a table, the user could select
the recordset by the Name. My problem is that the fieldentry of the
selecttag is not transfered to the executionscript. The different Names
within the recordset are shown correctly.
Here my listing
<?
mysql_connect("localhost","root");
$result=mysql_db_query("chorportal","SELECT * FROM choere ORDER BY
Name");
echo "<select value='chorid'>";
while($row = mysql_fetch_object($result))
{
echo "<option value=\'.$row->ID.\'>";
echo $row->Name;
echo "</option>";
}
echo "</select>";
?>
Regards,
Ruprecht
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php