Select List PHP,HTML
| From: | Chuck | Date: | Mon, 23 Aug 2004 19:21:48 +0000 |
| Subject: | Select List PHP,HTML | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-194515@lists.php.net to get a copy of this message | ||
Hello everyone,
I have been able to create a list with no problem, but now I need to get the
value of which item is selected in the list. I looked around, but couldn't
find anywhere that would let me do this.
Here's my code to build the list.
<SELECT name="Company List" multiple size="8">
<?php
$db = new COM("ADODB.Connection");
$dsn = "DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa;
DATABASE=BINDER";
$db->Open($dsn);
$rs = $db->Execute("SELECT * from company");
while (!$rs->EOF)
{
$Name = $rs->Fields['Name']->Value;
print "<OPTION>".$Name;
$rs->MoveNext();
}
?>
</Select>
I would appreciate any help I could get with this.
Thanks,
Chuck