Multi-statement queries
In PHP and MySQL programming, we can send only one query at a time using the mysql_query(
) function call. phpMyAdmin allows us to send many queries in one transmission, using a semicolon as a separator. Suppose we type the following query in the query box:
INSERT INTO author VALUES (100,'Paul Smith','111-2222'); INSERT INTO author VALUES (101,'Melanie Smith','222-3333'); UPDATE author SET phone='444-5555' WHERE name LIKE '%Smith%';
We will receive the following results screen:
We see the number of affected rows through comments because $cfg['VerboseMultiSubmit']
is set to TRUE
.
Let us send the same list of queries again and watch the results:
It is normal to receive a Duplicate entry error message that says the value 100 exists already. We are seeing the results of the first INSERT statement; but what happens to the next one? Execution stops at the first error because $cfg['IgnoreMultiSubmitErrors']
is set to FALSE
telling phpMyAdmin not to ignore errors in multiple...