我创建了几个像这样的查询 $reponse = $bdd->query('SELECT * FROM jeux_video');
如果我不放置 closeCursor()
每一个之后的 code> 语句都不会出现错误...那么,在哪些情况下 closeCursor()
有用?
最佳答案
根据手册:
PDOStatement::closeCursor() frees up the connection to the server so that other SQL statements may be issued, but leaves the statement in a state that enables it to be executed again.
This method is useful for database drivers that do not support executing a PDOStatement object when a previously executed PDOStatement object still has unfetched rows. If your database driver suffers from this limitation, the problem may manifest itself in an out-of-sequence error.
看看这是否有助于您更好地理解关闭光标的使用。
关于php - 在MySql中如果我不放置closeCursor会怎样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35429897/