有两个数据库连接$conn1和$conn2,当我使用$conn1->query('sql1',mysqli_use_result),之后在使用$conn2来从数据库取出数据。$conn2 会产生Commands out of sync错误吗?
尝试了一下,感觉当我使用一个mysqli_use_result之后,所有的表都被锁了,知道那个sql执行完成之后,其他query才执行
有两个数据库连接$conn1和$conn2,当我使用$conn1->query('sql1',mysqli_use_result),之后在使用$conn2来从数据库取出数据。$conn2 会产生Commands out of sync错误吗?
尝试了一下,感觉当我使用一个mysqli_use_result之后,所有的表都被锁了,知道那个sql执行完成之后,其他query才执行
5 回答3.2k 阅读✓ 已解决
3 回答3.6k 阅读✓ 已解决
1 回答4k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
2 回答2.2k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
5 回答1.4k 阅读
在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.