Reputation: 155
I have an application that queries records from database and every record has an edit button.
Consider the following scenario with two users - U1 and U2:
1.U1 queries record no 1.He clicks on edit and changes some values.
2.Meanwhile U2 also tries to edit the same record and clicks Save.U2's changes are saved to database.
How can I implement the functionality in which, when U1 tries to save his changes ,he gets the following error "Record has been modified by another user.Query again to see the changes".
Note:I do not want either users to be prompted on click of Edit that it is being modified by another user.This is because it is also a View button.Do not want users to restrict their viewing. Any help would be great.
Thanks
Upvotes: 0
Views: 235
Reputation: 219914
last_updated
time in a session variable.last_updated
time again.Upvotes: 0