Okay,
So I'm trying to write a query that will update a certain value in my database, but I want it to update only when 3 conditions are met. Basically, I want to update a column of ints in my DB (mysql) from 0 to a 1, if these criteria are met. 0 and 1 are the only values that are valid in this particular column.
dbquery("UPDATE times SET approval = '1' WHERE id = '$id' AND time <= '$currentTime' AND project = '$project'");
that is my query. Now, I'm not even sure if THIS part works. It is however, slightly more complicated in that this query is actually embedded in a foreach loop:
$result = $_REQUEST["projects"];
$delimiter - ",";
$projectArray = explode($delimiter, $result);
foreach($projectArray as $project){
dbquery("UPDATE times SET approval = '1'
WHERE id = '$id'
AND time <= '$currentTime'
AND project = '$project'");
}
If you can make any sense of that, and if you can point out any glaringly obvious mistakes here, I would appreciate it. If you need any other information let me know. Thank you all for your help.