When should I use closeCursor() for PDO statements?

后端 未结 1 781
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 08:49

The PHP documentation on closeCursor() says that it

frees up the connection to the server so that other SQL statements may be issued, but leaves the s

相关标签:
1条回答
  • 2020-12-06 09:29

    This depends on the driver used. I think for mysql this will do nothing else than clear the result of the statement. After calling closeCursor() you cannot call fetch() anymore. However executing the statement again should not be a problem. Try to look at mysql_free_result(), it does a similar thing.

    0 讨论(0)
提交回复
热议问题