复制代码 代码如下:
//执行SQL语句 锁掉stat_num表
$sql = "LOCK TABLES stat_num WRITE"; //表的WRITE锁定,阻塞其他所有mysql查询进程
$DatabaseHandler->exeCute($sql);
//执行更新或写入操作
$sql = "UPDATE stat_num SET `correct_num`=`correct_num`+1 WHERE stat_date='{$cur_date}'";
$DatabaseHandler->exeCute($sql);
//当前请求的所有写操作做完后,执行解锁sql语句
$sql = "UNLOCK TABLES";
$DatabaseHandler->exeCute($sql);
新闻热点
疑难解答