RE: [PHP-DB] Application-based locking with PHP?

From: Date: Mon, 17 Sep 2001 19:10:47 +0000
Subject: RE: [PHP-DB] Application-based locking with PHP?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-12516@lists.php.net to get a copy of this message
PostgreSQL does row-level locking... But I'm more familiar with MySQL, as I presume you are... If you want to rely on MySQL's table locking, but are worried about a user aborting the script, see: http://www.php.net/manual/en/ref.misc.php A combination of ignore_user_abort() and connection_aborted() will allow you to determine if the user has aborted, and unlock the table accordingly. -----Original Message----- From: Barry L. Jeung [mailto:bjeung@teamlynx.com] Sent: Monday, September 17, 2001 3:00 PM To: php-db@lists.php.net Subject: [PHP-DB] Application-based locking with PHP? 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. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#12516) next »