INSERT dynamic values problem - Need help urgently!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all:

I am trying to create a registration form whereby one of the user input is as 
follows: (a drop down menu with values retrieved from DB):
-----------------------------------------------------------------------------

<td class="lighter" width="350">Class Code:</td>
<td class="lighter" width="450">
<select class="textarea" name="class_code">
<?
$sql = mysql_query("SELECT DISTINCT class_code FROM class");
while ($row = mysql_fetch_array($sql))
{
 print "<OPTION VALUE=\"$class_code\" >" .$row["class_code"]. "</option>";
 }
$result = $db->query($sql);

?>

</select>

-----------------------------------------------------------------------------

My problem was:

1. I was unable to print the values I have selected from this drop down menu 
and 

2. insert this "dynamic values" into the DB??

I was able to insert static values into DB but not "dynamic" values...
How should I go about doing this? 
Really need some help here...


Thanks in advance. All help are greatly appreciated.


Regards,
 
Irin.

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux