Transaction Rollback
Moderator: General Moderators
Re: Transaction Rollback
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.
Re: Transaction Rollback
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__.
Tip: if you mean row numbers like line numbers in your code then use __LINE__.
Re: Transaction Rollback
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.
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.