Is there anyway to carry out an SQL transaction in one command? eg
mysql_query("
START TRANSACTION;
INSERT INTO table1 ....etc;
INSERT INTO table 2.....;
COMMIT;");
Or do you always have to use separate commands? eg
mysql_query("START TRANSACTION;");
mysql_query("INSERT INTO etc etc
Thanks
You can, by using PDO instead of pure mysql statements,
Of course, this is just a quick example, you should use prepared statements instead and use bind variables for the user input so you won’t have to worry that much about sql injections.