MySQL Forums
Forum List  »  InnoDB

Not locking....
Posted by: Arend Jan Zwart
Date: September 22, 2008 01:34AM

I have the following PHP code... the second SQL statement should not be executed...

There are 3 records in this DB, al have set 'menu'at page..

i run this SQL statement...

$resource = mysql_query("START TRANSACTION;") or die (mysql_error());
$resource = mysql_query("SELECT * FROM `data` LIMIT 3 FOR UPDATE;") or die (mysql_error());

I display the result, bit never close the transaction.
The i start this new one... and strangly enough it works. But the rows should still be locked because of statement one ??

$resource1 = mysql_query("START TRANSACTION;") or die (mysql_error());
$resource1 = mysql_query("SELECT * FROM `data` WHERE `page` = 'menu' LIMIT 3 LOCK IN share mode;") or die (mysql_error());

Does anyone know's a solution ??

Options: ReplyQuote


Subject
Views
Written By
Posted
Not locking....
3003
September 22, 2008 01:34AM
1676
September 28, 2008 08:27PM
1688
September 29, 2008 05:03AM
1651
September 29, 2008 06:53PM
1652
October 04, 2008 06:03AM
1569
September 28, 2008 10:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.