![]() |
|
|
+ Search |
![]()
|
Jan 24th, 2001 22:59
Joshua Ariizumi, Gary Smith,
This code will lock table1 so it can be updated without the WHERE
condition possibly being altered:
mysql_query("LOCK TABLES table1 WRITE;") or die("Can't lock tables");
mysql_query("UPDATE table1 SET ...... WHERE ....") or die("Can't
perform update");
mysql_query("UNLOCK TABLES");
As long as both locking and unlocking are done in the same script,
locking should go fine.