I am needing a dropdown menu to pull data from table on a mysql database and then with the selected item, send it to a new table along with the rest of the data from the form.
I have got the dropdown pulling data from the database with the following code:
<?php
$con = mysql_connect($sqlserver,$sqluser,$sqlpassword);
if (!$con)
{
die('Connection to SQL Server failed. Error: ' . mysql_error());
}
mysql_select_db($sqldb, $con);
$result = mysql_query("SELECT functions FROM functions");
echo "<SELECT id=\'func\' name=\'func\' multiple=\'multiple\'>";
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
echo "<option value=\'$row[functions]\'>$row[functions]</option>";
}
}
echo "</SELECT>";
mysql_close($con)
?>
Which works fine,
however I am totally baffled as to how i get it to send with the form. Is there something im missing here?
Cheers.