Quote:
Originally Posted by senthilswing
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.