You are here: Re: Query and Synchronization... « PHP Programming Language « IT news, forums, messages
Re: Query and Synchronization...

Posted by Rik on 04/25/07 22:07

Giovanni wrote:
> Hi people!
> I was writing a function in which I execute a query to READ some
> value, and another one to UPDATE the previous query related data.
>
> i.e.
> query-> select * from ..... to retrieve myvalue
> read myvalue
> change myvalue
> query-> update myvalue
>
> Suddenly I had a doubt...
> Can 2 or more browsers call the same function at "same time" and start
> the UPDATE query with some still uncomputed data? or is the function
> synchronized?

Well, 'uncomputed data', no... They can overwrite each others changes
though. Most of my systems aren't that busy, so I opt for:


UPDATE table SET field1=..., field2=... WHERE field1=..., field2=...

If there's no row updated, report the record has been changed, and ask
the user again...

--
Rik Wasmus

Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!

 

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

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