Re: Application-based locking with PHP?

From: Date: Tue, 18 Sep 2001 17:13:27 +0000
Subject: Re: Application-based locking with PHP?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-12548@lists.php.net to get a copy of this message
Hi! InnoDB type tables in MySQL provide row level locking and transactions. See http://www.innodb.com Regards, Heikki Tuuri Innobase Oy .... Barry L. Jeung wrote in message ... Just wondering if anyone has tried doing quasi application based locking with PHP? My scenario is this. I'm constructing a database for my company to help keep track of trouble tickets, etc with a web-based frontend. I'm using PHP (obviously =]) for inputing/retrieving data and have a slight predicament. Since MySQL does table-level locking, if I put lock statements in my queries, it would cause two problems. One being the entire table being locked and two if the user just closes the webpage without exiting properly, the table would remain locked indefinately. So I'm trying to think of alternatives, one of which is using global variables to store table/record id's, and then evaluating the queries based on that information. So if John selects ticket # 5 and might be updating it, then when Bob attempts to select ticket #5, then the $id and $table variables would be checked against the variables stored when john placed his query, and bob would get a message saying that record #5 is locked or in-use by John and to try later. Is this feasible or is there a better way to do this? Thanks for your time.

« previous php.db (#12548) next »