Hi all, I'm new to these forums. Hopefully someone can help.
I've created a dropdown menu by calling an array:
<select name="prop_area" size="1" class="boxes">
<?PHP
$places = mysql_query ("SELECT * FROM places order by name");
$ordered = array();
while ($placelist = mysql_fetch_row($places)) {
$id = $placelist[0];
$name = $placelist[1];
$ordered[$id] = $name;
}
natsort($ordered);
while (list($id,$use) = each($ordered)) {
$placeid = current($ordered);
$option = "<option value=\"$id\"";
if ($id == $area) {
$option .= " selected";
}
$option .= ">";
$option .= "$use</option>";
print $option;
}
?>
</select>
Now, what I want to do is use $_POST to process the selected item from the menu and insert it into a table. How would I do this? If I use
$prop_area = $_POST['prop_area'];
And then
$query = "INSERT INTO table (area) ".
"VALUES ('$prop_area')";
mysql_query($query) or die('Error, query failed : ' . mysql_error());
...it doesn't work!!! Can anyone help me?
Cheers,
WoolyG