I have the following script that will update all the records that are checked via a checkbox in the database with a value of "Start". It works fine except that I want users to be able to uncheck a checkbox and have the record be updated with a value of "Bench". Can someone help me. See code below:
foreach($HTTP_POST_VARS as $key=>$val)
{
if (ereg("([0-9]+)",$key,$regs))
{
$posted_id=$regs[1];
$posted_check=$val;
$sql="UPDATE rosters SET Status='$posted_check' WHERE RosterID='$posted_id'";
$result=$otsconnection->Execute($sql) or die($otsconnection->ErrorMsg());
}
}
Thanks,