数据库mysqli_use_result

有两个数据库连接$conn1和$conn2,当我使用$conn1->query('sql1',mysqli_use_result),之后在使用$conn2来从数据库取出数据。$conn2 会产生Commands out of sync错误吗?
尝试了一下,感觉当我使用一个mysqli_use_result之后,所有的表都被锁了,知道那个sql执行完成之后,其他query才执行

阅读 1.5k
1 个回答

在mysql官网上看到的
On the other hand, you should not use mysql_use_result() for locking reads if you are doing a lot of processing for each row on the client side, or if the output is sent to a screen on which the user may type a ^S (stop scroll). This ties up the server and prevent other threads from updating any tables from which the data is being fetched.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题