|
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]
|