Reputation: 17467
I have 3 mysql queries to run
mysql_query( "create temporary table here ");
mysql_query( "UPDATE Statement goes here ");
mysql_query( "DROP temporary table here ") or die(mysql_error())
how do I wrap these in a transaction?
Upvotes: 0
Views: 215
Reputation: 3414
you can use mysqli_multi_query
mysqli_multi_query("CREATE ...;UPDATE Statement.. ; DROP temp ");
note the ; between queries.
Upvotes: 0
Reputation: 65274
You don't. DDL statements, such as create temporary table here
are never part of a transaction in MySQL.
Upvotes: 2