php: how to run several php multi_query statement

42 Views Asked by At

I need to understand how the MySQLi multi_query() works.

I'm working on table 'stefano' with (unique) field 'f1'.

If I run

<?
$db->multi_query(
    "insert into playground.stefano (f1) values ('a'); insert into playground.stefano (f1) values ('b');"
);
$db->multi_query(
    "insert into playground.stefano (f1) values ('c'); insert into playground.stefano (f1) values ('d');"
);
?>

Only 'a' and 'b' values are filled into DB.

Please dot't tell me that I can use an unique multi_query statement with 4 different queries. I know that I can, but I need to understand why the 2nd multi_query is ignored.

0

There are 0 best solutions below