For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Re: [PHP-DB] Update multiple tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Update multiple tables
John Holmes

2004-08-26, 3:58 pm

From: "Khalid Judeh" <khjudeh@yahoo.com>
> 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).


When asking questions like this, it's a smart idea to actually mention what
database you're using.

Either way, you need to use transactions. Either use a database that
supports them (most of them do, to varying degrees of complexity) or use a
database abstraction layer that simulates them. ADOdb comes to mind,
although I've never used that feature. http://adodb.sourceforge.net

---John Holmes...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com