Welcome Guest, Not a member yet? Register   Sign In
Multi user application
#13

[eluser]WanWizard[/eluser]
Correct. The sequence is this:

User requests an update form:
- SELECT * FROM table WHERE id = 'something'
- field table.last_update_timestamp contains the timestamp of the last update
- form is displayed, contains a hidden field containing the timestamp value
( you can store it in the session if you don't want to expose it in the form )

User posts the form:
- validate the form
- UPDATE table SET fields, last_update_timestamp = 'new_timestamp' WHERE id = 'something' AND last_update_timestamp = 'retrieved_timestamp_value'.

If this UPDATE returns affected_rows() == 0, than no record was updated, and the assumption is made that this is because of a mismatch of the timestamp. This can be caught so action can be taken.


Messages In This Thread
Multi user application - by El Forum - 07-15-2010, 02:57 PM
Multi user application - by El Forum - 07-15-2010, 03:39 PM
Multi user application - by El Forum - 07-15-2010, 03:42 PM
Multi user application - by El Forum - 07-15-2010, 03:49 PM
Multi user application - by El Forum - 07-15-2010, 04:06 PM
Multi user application - by El Forum - 07-15-2010, 07:15 PM
Multi user application - by El Forum - 07-16-2010, 02:50 AM
Multi user application - by El Forum - 07-16-2010, 03:18 AM
Multi user application - by El Forum - 07-16-2010, 06:40 AM
Multi user application - by El Forum - 07-16-2010, 04:07 PM
Multi user application - by El Forum - 07-17-2010, 04:18 AM
Multi user application - by El Forum - 07-17-2010, 04:29 AM
Multi user application - by El Forum - 07-17-2010, 05:06 AM
Multi user application - by El Forum - 07-17-2010, 05:09 AM
Multi user application - by El Forum - 07-17-2010, 05:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB