Should I do
$dbh->beginTransaction();
try{
Or
try{
$dbh->beginTransaction();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t really matter, it will run the code indifferent of it’s position.
But you want to put the
rollback()in thecatch, and with that setup it’s not readable if you putbeginoutside.I would vote for inside the
try.