0

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!

Edited by SQL_n00b: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by buddylee17
0

The lock is written into the query. You'll need to check into the correct syntax for your specific database.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.