Hello everyone,
I am trying to pass a value taken from a table (catlisting) to a different table (categories)
I am ok with the drop down. I have problems with passing the selected value into the other table.
Can someone help me please?
Thanks
Sal
$sql1 = "INSERT INTO categories (id, username, category) VALUES ('', '$username', '$category')";
$result = mysql_query($sql1) or die("ERROR: cannot INSERT data into database");
echo "$sql1<br>";
$sql = mysql_query("select category from catlisting") or die("Unable to process queries at this time: " . mysql_error());
while ($row = mysql_fetch_array($sql))
{
//$id = $row["id"];
$category = $row["category"];
$result .= "<OPTION value=\"$category\">$category</OPTION>";
}
?>
<form method="post">
<SELECT NAME="category ID="category">
<option value="" >Select category</option>
<? echo "$result"; ?>
</SELECT>
<br><input type="text" name="username" >Username<br>
<INPUT TYPE=SUBMIT VALUE="Enter" ID="category">
</FORM>