MySQL Forums
Forum List  »  InnoDB

How can i do record level locking using PHP?
Posted by: Munish Aggarwal
Date: February 18, 2005 04:45AM

version that i am using
PHP version=4.3.1
Mysql version=4.0.22-nt

I have problem in taking the record level locking.
When i take the lock on MYSQL command line . it works

mysql>begin work;
mysql>select * from tblemp where empid=1 for update;

Now no other user is able to update the record of empid=1.
untill i run the command


but when i tried this thing by PHP code. it does not work.

One more thing, how can i use the same link that i have created on other php page.I do not want to creat link again and again for every new php page by code

$link = mysql_connect($Server,$Usr,$Pwd);

i want $link as global and can be user directly on any page if once is created.
i have also tried by making the $link to global variable. but not working
Help me out from these problems

Options: ReplyQuote

Written By
How can i do record level locking using PHP?
February 18, 2005 04:45AM

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.