DB access and sessions
| From: | Bret Walker | Date: | Wed, 17 Aug 2005 22:18:45 +0000 |
| Subject: | DB access and sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-220810@lists.php.net to get a copy of this message | ||
Hello-
I'm developing a web-based system whereby users can edit documents and
then e-mail the documents to selected recipients.
The "documents" are comprised of the data from several MySQL fields.
I want to make sure that two people don't edit a document at the same time.
My users log in via a script that starts a session.
My initial idea was to have a field to denote file access (1 for "in
use" 0 for available). The problem with this would be if a user
navigates to a different page or closes the browser window without
clicking a "save" or "close" button (which would execute a query to set
the in_use field to 0).
I'm sure others have dealt with the issue of exclusive access to a MySQL
resource. I've looked into InnoDB transactional support, but that
doesn't seem to be what I need, since I'm not overly concerned about
simultaneously access, just simultaneous editing.
How can I ensure the "document" isn't accessed by two people at the same
time?
Thanks,
Bret
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s