What is the best way to update a record when 2 users of my site happen to edit it simultaneously?
For example, assume the following scenario:
Let's say users John Doe and Jane Doe log into my site and happen to view the below record simultaneously.
---------------------------------------------------------------------------------
Bruce Wayne | Gotham City | (910)000-0000
---------------------------------------------------------------------------------
If John edits the above phone number to (910)000-0001 and Jane changes it to (910)000-0002 - at the same time - what value do I update the DB with?
How do I prevent users overwriting each others' updates? Is something like <cflock> useful in this case or is it purely an SQL thing?
Thanks!