Re: [mysql] query atomicity
| From: | :B nerdy | Date: | Wed, 04 Sep 2002 13:47:47 +0000 |
| Subject: | Re: [mysql] query atomicity | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21567@lists.php.net to get a copy of this message | ||
i am unfarmillar with InnoDB, i am currently using MyISAM i believe. just
the default one.
i am a complete noobie with InnoDB, do i have to convert my db?
cheers
"Andrey Hristov" <andrey@webgate.bg> wrote in message
news:014d01c2540b$d309bf40$1601a8c0@andreywin...
> 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@mail.usyd.edu.au>
> To: <php-db@lists.php.net>
> 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
> >
>