PHP-MYSQL - How to implement - "Record has been updated by another user" -
i have application queries records database , every record has edit button.
consider following scenario 2 users - u1 , u2:
1.u1 queries record no 1.he clicks on edit , changes values.
2.meanwhile u2 tries edit same record , clicks save.u2's changes saved database.
how can implement functionality in which, when u1 tries save changes ,he gets following error "record has been modified user.query again see changes".
note:i not want either users prompted on click of edit being modified user.this because view button.do not want users restrict viewing. great.
thanks
- when loading data edited save
last_updated
time in session variable. - when saving form, before save
last_updated
time again. - if match, save form. if not, reject not being in sync.
Comments
Post a Comment