Now that MySQL has different table types which support transactions
(bdb, gemini) it's desirable to build transaction blocks for MySQL PHP
driven programs, just like you can for PostgreSQL.
When I tried to do this, however, I couldn't find a MySQL equivalent for
pg_Exec, which does except multiple SQL statements.
mysql_db_query & mysql_query apparently accept only a single SQL
statement.
If I try to execute the following, it fails with a syntax error at the
end of the first statement:
= = = = =
$transaction_sql = "BEGIN;
$add_item_sql;
$purchase_queue_sql;
$log_sql;
COMMIT; ";
include "connect.inc";
$result = mysql_db_query("inventory", $transaction_sql, $conn);
= = = = = =
With PostgreSQL, it works fine (after you change mysql_db_query to
pg_Exec!).
So, does anyone know of a way to execute multiple SQL statements with
MySQL or am I forced to execute one at a time?
Thanks in advance,
Art
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]