On Wed, 25 Aug 2004 22:08:03 -0700 (PDT), Khalid Judeh
<[EMAIL PROTECTED]> wrote:
> Hello,
> I have a script that make changes to the database in more than one sql statement, as 
> i need to update more than one table at the same time, I want to know if there is a 
> method where all of those changes are committed, or rolled back if some error 
> occured(lets say in the last sql statement).
> thanks


Use transactions :

BEGIN TRANSACTION
...sql statements...
COMMIT

or

ROLLBACK

The implementation varies a little. Check out the documentation/manual
of  your database  server for "transactions".

(PHP also has built-in functions for transactions such as
mysqli_commit(), mysqli_rollback() and mysqli_autocommit()  for
mysqli.)


HTH.

----

ramil

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to