On 9 Jul 2002 at 22:07, Thomas Edison Jr. wrote:

> why the transaction is interrupted, i would like the
> transaction to roll back.. that is, all the records
> entered before the interruption SHOULD NOT remain in
> the database, they should get deleted or something, so
> that the transaction can begin Fresh from next time. 
> How can i make such a function that will see this
> happens, in my PHP/mySQL.

Well be sure that your MySQL supports transactions. InnoDB or something. In perl it's 
just a case of eval {sql here} if($@ ) {rollback}else commit, the $@ is empty unless 
the eval created an error. 
Now, let me see how PHP does this, Google, where are you?


Might want to be sure your MySQL supports transactions and is configure appropriately 
or you can drive yourself nuts.


And then some ideas about how to do it with PHP:


(wow, right from php.net)


I've never used mysql for anything but a data store so I have no examples myself.


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

Reply via email to