Hi all. Here's what I'm trying to do.
I've got a CMS which will have multiple users able to access the same files. I need to come up with a way such that the files can be "checked out" and "checked in" so to speak.
What I was thinking was to add a field at the end of the table which would be set to 0 if the file was available, 1 if not.
When a user tried to access the file, if the file was available the field would be set to 1 before the user edited the content (basically an update to set the field to 1 would be executed before the select statement), and the next user who tried to access it would see a "file is locked" message, until the first user saved and closed the file.
Is there a better way to do this on a database level which would be more efficient but still give me the information I'd need to display to the user, whether the record was available for editing or not?
Thanks,
P.