When multiple people insert or update the same table at the same time, the same piece of data often appears multiple times or some strange problems occur. This problem can be solved by queuing through the MySQL table lock mechanism.
Lock the table before inserting data in php
// lock talbe write
$sql = "LOCK TABLES alliance_perf WRITE";
mysql_query($sql, $this->mysql->conn);
unset($sql);
////////This is the data insert operation
// unlock table
$sql = "UNLOCK TABLES";
mysql_query($sql, $this->mysql->conn);
unset($sql);
http://www.bkjia.com/PHPjc/532696.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532696.htmlTechArticleWhen multiple people insert or update the same table at the same time, the same piece of data will often appear. Many times or some strange problems can be solved through the lock table mechanism of mysql...