I'm trying to pass a query to mysql from php to update two rows in the same table. The update does not work through my website, mysql_num_rows and mysql_affected_rows both return -1 and the update does not take place. However, when i echo the sql query to the screen and insert this sql into phpmyadmin the query works.
this is the query:
$sefql = "UPDATE `slots` SET `dj_id` = '$new_slot' WHERE `dayofweek` = '$dd' AND `month` = '$mm' AND `year` = '$yy' AND `slot_no` = '$slot_no';
UPDATE `slots` SET `dj_id` = '$new_slot' WHERE `dayofweek` = '$dd' AND `month` = '$mm' AND `year` = '$yy' AND `slot_no` = '$slot2'";
Thanks.
NOTE: All vars are present.