php-db | 2002091
Date: 09/04/02
- Next message: Pierre-Alain Joye: "Re: [PHP-DB] Using a variable as a variable name"
- Previous message: :B nerdy: "[PHP-DB] [mysql] query atomicity"
- In reply to: :B nerdy: "[PHP-DB] [mysql] query atomicity"
- Next in thread: :B nerdy: "Re: [PHP-DB] [mysql] query atomicity"
- Reply: :B nerdy: "Re: [PHP-DB] [mysql] query atomicity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Choices
1) Use InnoDB
2) If you cannot use innodb than you can write your code in the way you add
in an array
queries that will rollback the change :
if you do
$r1 = mysql_query('insert into some_table (k1,k2) values (4,2);');
$r1 = mysql_query('insert into some_table (k1,k2) values (5,3);');
you must have in the rollback array this
$rollback_ar = array('DELETE FROM some_table WHERE k1=4 and k2=2;',
'DELETE FROM some_table WHERE k1=5 and k2=3');
Hope this is clear.
Best regards
Andrey Hristov
----- Original Message -----
From: ":B nerdy" <thoa0025 <email protected>>
To: <php-db <email protected>>
Sent: Wednesday, September 04, 2002 3:04 PM
Subject: [PHP-DB] [mysql] query atomicity
> how would i go about making a few queries into a transaction - that is, if
> one of them fails, the previous queries get rolled back...
>
> cheers
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Pierre-Alain Joye: "Re: [PHP-DB] Using a variable as a variable name"
- Previous message: :B nerdy: "[PHP-DB] [mysql] query atomicity"
- In reply to: :B nerdy: "[PHP-DB] [mysql] query atomicity"
- Next in thread: :B nerdy: "Re: [PHP-DB] [mysql] query atomicity"
- Reply: :B nerdy: "Re: [PHP-DB] [mysql] query atomicity"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

