Code: Select all
if (isset($_POST['go']))
{
foreach ($_POST['uniqueID'] as $id)
$update = mysql_query("UPDATE mytable SET status='".$_POST['select']."' WHERE id='".$id."'");
}
$_POST['select'] is a dropdown list contains 3 values. I want to take one of the selected values and put this value into a column in mysql when submit button is pressed. FYI: I am updating multiple columns in my DB.
$_POST['uniqueID'] is a hidden field with value $row['id'] pulled from database.
I have also tried to use this code:
Code: Select all
if (isset($_POST['go']))
{
$update = mysql_query("UPDATE mytable SET status='".$_POST['select']."' WHERE id='".$_POST['uniqueID']."'");
}
Sorry I'm new to php and I'm stuck, I need to know what am I doing wrong. thanx