Home  >  Article  >  Backend Development  >  为啥给表加了读锁之后无法把数据查询出来

为啥给表加了读锁之后无法把数据查询出来

WBOY
WBOYOriginal
2016-06-13 12:34:28852browse

为什么给表加了读锁之后无法把数据查询出来?

mysql_query("LOCK TABLES tablename READ;");<br />
$result=mysql_query($sql, $conn);<br />
mysql_query("UNLOCK TABLES;");

注释掉第一条语句之后能够正常地把记录查询出来,但是一旦使用第一条语句就什么都查不出来了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn