prevent two users editing same record

admin

Administrator
Staff member
I have a <FORM> that will allow users to
pull up existing database records.

Does anybody have a trick/scheme that will
prevent two users from editing the same
database record (opening the same record
in the <FORM>)?


I tried to come up with a "locking" scheme
of my own but have ran into several
problems.


( My most recent thought was to do a SELECT
* query. Then do a mssql_fetch_object call
(yes, I am using MS SQL SERVER). Then store
the serialize'd object into a session
variable. Then when the user submits their
data, do a SELECT * query again and compare
that to the saved result, if the two do not
match, the record was changed by someone
else whilst they were on their page.

Does anybody have an opinion on this idea? )
 
Back
Top