Locking and unlocking records
| From: | Lowell Allen | Date: | Thu, 15 Jan 2004 20:49:22 +0000 |
| Subject: | Locking and unlocking records | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-174699@lists.php.net to get a copy of this message | ||
I need to implement database record locking and unlocking. I want to prevent
multiple users of a content management system from editing the same record
simultaneously, which can result in one user's edits being overwritten. I
can use PHP to lock a record when it's opened, and unlock it when it's
updated or if the user goes anywhere else within the content management
system (or logs out), but I need to account for a user leaving the CMS
directly from the edit screen. I'm not aware of any way to do that other
than using a Javascript onunload event to open a new window, run a PHP
script, and close the new window onload -- very nasty and unreliable with
pop-up blocking so popular. Can anyone suggest an all-PHP way?
TIA
--
Lowell Allen