From: Alex Farran <a...@alexfarran.com>
Date: Mon, 09 Feb 2004 15:16:51 +0000
Subject: Re: MySQL Lock ?
I was under the impression that MySQL has some sort of queue that
prevents corruption due to multiple concurrent writes.
If he does
SELECT current value;
INSERT record with value;
it is possible, if more than one person is using the system, for
multiple users to read the same current value and so insert the same
value.
Without using triggers or subselects I'm not sure how you could do it
reliably.
..
..Um, LOCK TABLES?
..
..http://www.mysql.com/doc/en/LOCK_TABLES.html
..
..If you can't do that for some reason, you could always implement your
..own locking mechanism around the PHP that executes the query.
I'm sure a lot of people do this in PHP, and I'd love to hear some
approaches that have been tried, and what works. Is there a concensus
about what the best model is?