If that fails, you delete the record, otherwise, you update it, meaning that everything is ok.
Luis Sousa
Raphael Hamzagic de Carvalho wrote:
Hi,
I dont know if transactions decrease considerable performance in register systems. For Example:
PHP algoritm:
$query = "Begin;"; pg_query($connId, $query);
$query = "insert into member values('Jim Jones', '21', 'passw', 'jim@bfr.com');"; pg_query($connId, $query);
if ( mail(jim@bfr.com, "Welcome", "", "")) { $query = "COMMIT;"; pg_query($connId, $query); } else { $query = "ROLLBACK;"; pg_query($connId, $query); }
I dont know if this is a good technique, but my point is: If the email that is sent to the user being inserted on database fails, I want to rollback transaction and dont register that user....
Thanks in advance!
Rapha
-- Luis Sousa Especialista de Informática Gabinete de Gestão de Informação, ext: 7837 Campus de Gambelas Universidade do Algarve, tel: 289800900
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php