I know this question may be asked too many times on these forums but I genuinely cannot find a solid answer. They all give different methods.
Anyway, I have this code to update one row:
$sql = "UPDATE $userName SET P1 = '$p1MON' WHERE day = 'MON1'";
Is it possible to update multiple rows in the same query? Something like this:
$sql = "UPDATE $userName SET P1 = '$p1MON' WHERE day = 'MON1',
UPDATE $userName SET P1 = '$p1TUE' WHERE day = 'TUE1',
UPDATE $userName SET P1 = '$p1WED' WHERE day = 'WED1'";
Or, to update multiple rows in one query, do they have to share an identifier?
Thanks.
EDIT: A suggestion in the comments , doesn't seem to work...
$sql = "UPDATE $userName SET P1 = '$p1MON' WHERE day = 'MON1';
UPDATE $userName SET P1 = '$p1TUE' WHERE day = 'TUE1';
UPDATE $userName SET P1 = '$p1WED' WHERE day = 'WED1'";