Reply to Re: How do I handle people going into the same record at the same in web app.

Your name:

Reply:


Posted by Rik on 05/20/06 18:36

Jerry Stuckle wrote:
> Sure you can guarantee it.
>
> $result = mysql_query("UPDATE myTable SET col1='$col1' AND
> col2='$col2'] "WHERE col1='$oldcol1' AND
> col2='$oldcol2'"); if (mysql_affected_rows != 1)
> echo "Data has changed!<br>";
>
> If either col1 or col2 has been changed the update will fail and
> mysql_affected_rows() will return zero.

This doesn't guarantee it, I admit we're talking mili-, no, microseconds
here. The problem is queries aren't instantanious, they take time.

2 Queries run:
USER1 UPDATE WHERE is searched
USER2 UPDATE WHERE is searched
USER1 SETS
USER2 SETS

So, user 2 has overwritten changes made bu user 1.

Likely no, possible yes.

Grtz,
--
Rik Wasmus

[Back to original 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

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