if ('$o1s' == 1) {
$ocode = 1;
$query6 = "UPDATE `offer_det` SET `ocode`='$ocode' WHERE `fname`='$fname' AND `lname`='$lname'";
$result6 = mysql_query($query6)or die(mysql_error());
}
$o1s is a radio select, essentially 1 = selected, 0 = not selected. ocode is the row in the database to be updated. $fname is the first name of the logged in user and $lname is the last name of the logged in user.
My thought process is if o1s is selected then update ocode to 1 where the first and last names match. I’m not seeing any action on the results though. This is a session post form. Can I even use the AND during an UPDATE?
this line needs to be like this,
Also, check the
$_POSTarray for the corresponding value ofo1swhen its selected and not, you would have to put anissetcheck when its not. And yes, you can useANDfor anupdate