Hi,

before you start to make inserts/updates to the database you can put
$db->query("begin;") -> this is to begin a transaction, in the end of the script
you put commit ($db->query("commit;") if all goes ok, otherwise rollback
($db->query("rollback;").

andré brás

Citando Andy Hall <[EMAIL PROTECTED]>:

> Hi,
>
> I have a PHP script that is running 4 queries. If the 4th fails, ideally I
> would like the other 3 queires to roll back and leave the database as if they
> were never run at all.
>
> Can anyone advise on any technique that would do this easily, as opposed to
> manually writing and running queries to set the database back (which would be
> messy IMO).
>
> This project is being developed on MySQL 3.23.37.
>
> Any help is appreciated, thanks.
>
> Andy Hall.
>

O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to