Current location: Hot Scripts Forums » Other Discussions » Database » Please Help me...


Please Help me...

Reply
  #1 (permalink)  
Old 09-14-09, 02:47 AM
senthilswing senthilswing is offline
Newbie Coder
 
Join Date: Aug 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Please Help me...

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.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-14-09, 07:40 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
Please post your code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-21-09, 05: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 05:19 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-06-09, 02:08 AM
sandeep.kumar's Avatar
sandeep.kumar sandeep.kumar is offline
Wannabe Coder
 
Join Date: Jun 2008
Location: India
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
I think you can use trigger to solve this problem.
__________________
sandeep kumar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:49 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.