Re: Database problem
| From: | Brent Cook | Date: | Wed, 15 Jan 2003 15:55:59 +0000 |
| Subject: | Re: Database problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3312@lists.php.net to get a copy of this message | ||
On Wed, 15 Jan 2003, Mike Carter wrote:
> Hi guys,
>
> When two people read the same database record out and have it displayed in
> their 'browser.
>
> Then person one makes changes and submits it back to the database - updating
> the row.
>
> Then person number 2 makes changes to his (now out of date) copy and submits
> it back to the database, effectively overwriting the update done by the
> other person!
>
> Any ideas or experience with such a problem?
>
> My first idea was to have a field for every row in every table which holds a
> version number - this gets incremented when somebody writes an update back
> over it. Before writing over it the version number of the data to be
> written and the version number of the existing record in the dbase are
> compared.
>
> Hmmm... What do people think?
This sounds reasonable. You could also use a timestamp.
- Brent