I have a two MySQL queries I'd like to combine, it works when I enter them directly to phpmyadmin. I get those queries like this:
$sqlCombine = $sqlStart.";".$sqlStartBefore;
$conn->query($sqlCombine);
echo $sqlCombine;
echo gives the following:
UPDATE rn_slots_availability SET slot_avail_noclean = slot_avail_noclean -1 WHERE hotel_id = '5' AND room_type_id = '6' AND slot_date = '2014-09-05';UPDATE rn_slots_availability SET slot_avail_clean = slot_avail_clean -1 WHERE hotel_id = '5' AND room_type_id = '6' AND slot_date = '2014-09-06'
copy/paste to phpmyadmin works like a charm, executing directly does not, gives the following error:
Error: 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 'UPDATE rn_slots_availability SET slot_avail_clean = slot_avail_clean -1 WHERE ho' at line 1
That is the second query, but I don't see why?
;in PHP. We also don't know what interface you use for MySQL interaction, so no one can suggest a workaround or proper approach.mysqlextension –mysqlihowever hasmysqli::multi_query.