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

  1. when loading data edited save last_updated time in session variable.
  2. when saving form, before save last_updated time again.
  3. if match, save form. if not, reject not being in sync.

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -