I\'m utilizing a Mysql based PDO connection with PDOStatement (::prepare()
; ::execute()
) and I\'ve run over some code from a
My understanding of PDOStatement::closeCursor()
is that it clears the result of a executed query. But not affects a PDOStatement
at all (just the result of its execution).
From the PHP Documnetation about this method:
frees up the connection to the server so that other SQL statements may be issued
and
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.
let me assume that you should make after every execution and fetch of all data you need form the current query execution a call to the PDOStatement::closeCursor()
method. I think the MySQL driver for PDO does this automatically but there seems to be problems with some drivers which does not automatically free up the result.
So if you switch to another DB driver which does not free up the pending result of the query you run into an error.