Can preprocessing be used in pdo transaction processing? Can preprocessing be used in pdo transaction processing? For example, can I roll back the transaction after the following code exception? PHPcodetry {$ pdo-& gt; beginTransaction (); $ SQL = 'Insert... '; $ pdo_pre = $ pdo-& gt; pr can preprocessing be used in pdo transaction processing?
Can preprocessing be used in pdo transaction processing? For example, can I roll back the transaction after the following code exception?
PHP code
Try {$ pdo-> beginTransaction (); $ SQL = 'Insert... '; $ pdo_pre = $ pdo-> prepare ($ SQL); $ pdo_pre-> execute ();} catch (PDOException $ e) {$ pdo-> rollBack ();}
Does the transaction operation of PDO take effect only for the PDO method, or does the PDO and PDOStatement take effect?
Thank you!
------ Solution --------------------
All take effect
But I didn't see the commit in your code.
------ Solution --------------------
View mysql transactions