View Single Post
  #3 (permalink)  
Old 09-21-09, 04:14 PM
GameFrame GameFrame is offline
Newbie Coder
 
Join Date: May 2009
Location: Finland
Posts: 35
Thanks: 0
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by senthilswing View Post
i have three my sql query... I want both the 3 query will run at the time.. If one query executes fails then rest of the query will be roll backed.....
I know what you are after. You can only check did your query failed due to misspelled table name, no connect at all etc. , then mysql will return actual error.

I tried to recently achieve same thing, i mean lets say you write something to any table, mysql returns 0, ok something got updated or not. Even with a warning, it will return 0 to
mysql_errno

Therefore to achieve what you are after, you need to actually check what previous query did before you are able to write rollback query because if there are real error like misspelled table name, first query never executes due to error and then there is no need for rollback query.

Finally you cannot run 3 queries at once instead you can run them one after another in same script.

Hopefully this helped you out a bit.

Last edited by GameFrame; 09-21-09 at 04:19 PM.
Reply With Quote