in my db have 20+ columns. i added 19 columns throught input form and stored in db succesfully. i fetch few details from db in my main page. in my main page 1 more column is there. that is status column, it is a combo box. if i click status column it should show 4 values. i want to select that values and click save button it must go to stored in db with that same ID. how to do that?
mainpage combo box coding:
echo "\t<td width=148><form action=statusdb.php method=post>
<select name=update><option value=empty></option><option value=Confirm>Confirm</option><option value=Processing>Processing</option><option value=Pending>Pending</option><option value=Cancelled>Cancelled</option></select>
<input name=\"update[".$a_row['slno']."]\"; type=submit value=Save></form>
</td>\n";
status db code:
if (isset($_POST['update']))
{
$update = mysql_real_escape_string(trim($_POST['update']));
$sql = mysql_query("UPDATE guestdetails SET status = $update WHERE ($slno) = '$slno'");
if(!mysql_query($sql, $connect))
{
die("Error:" .mysql_error());
}
}
if anyone knows help me..