I'm trying to "force" this code to run through every line and update every line that matches the statement above..
if(isset($itemID1) && isset($itemID2) && isset($itemID3) && isset($itemID4) && isset($itemID5) && isset($itemID6) && isset($itemID7) && isset($itemID8) && isset($itemID9) && isset($itemID10)){
$upd = "UPDATE booking SET status='$status/ADM', verification='No'";
if($CalDate !=''){
$upd.= ",CalDate='$CalDate'";
}
if($DueDate !=''){
$upd.= ",DueDate='$DueDate'";
}
if($groupid1 != 0){
$upd.= " WHERE groupid IN ('$groupid1')";
}
if($groupid2 != 0){
$upd.= " WHERE groupid IN ('$groupid2')";
}
if($groupid1 == 0){
$upd.= " WHERE itemid IN ('$itemID1')";
}
if($groupid2 == 0){
$upd.= " WHERE itemid IN ('$itemID2')";
}
}
Known errors: Error could not update data reason: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE itemid IN ('143')' at line 1
Either that or the script will only update the first line that it passes by. As for groupid1 != 0