yup - use transactions.
http://www.mysql.com/doc/en/COMMIT.html
--- Matthew Oatham <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there an elegant way to recover from DB errors in
> MySQL using PHP, i.e. transactions and rolling back
> - basically I have an insert statement then an
> update statement. if the insert succeeds the update
> is run but if the update fails I want to undo the
> insert! 
> 
> Any suggestions, I guess I could get the last
> inserted row id and perform an sql delete but is
> there a more elegant way?
> 
> Cheers
> 
> Matt


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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

Reply via email to