You are here: how to mimic table locking from PHP? « PHP Programming Language « IT news, forums, messages
how to mimic table locking from PHP?

Posted by lkrubner on 11/01/05 19:29

I saw that this conversation took place on this newsgroup last year:

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?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация