PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed May 27, 2020 7:07 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Re: Transaction Rollback
PostPosted: Wed Oct 15, 2014 1:26 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
Just do everything like normal: check that queries succeed, grab error information if they don't, that kind of thing. Transactions can help you deal with error cases and race conditions but they don't have much else of an impact on your code design.


Top
 Profile  
 
 Post subject: Re: Transaction Rollback
PostPosted: Wed Oct 15, 2014 2:32 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
So... do that. I don't see what's preventing you from reporting your own error messages according to however you feel. Maybe you have an example of what you're working with?

Tip: if you mean row numbers like line numbers in your code then use __LINE__.


Top
 Profile  
 
 Post subject: Re: Transaction Rollback
PostPosted: Wed Oct 15, 2014 10:09 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
If the query fails, MySQL will not tell you exactly what row caused it to fail. You'll have to figure that out for yourself.

Check your data before you try to do anything. If the data is good then continue, if the data is bad then stop. Since you're the one checking the data you will know exactly why you thought it was bad.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group