I have a search class that keeps prepared PDO statements around for re-execution with new parameters each time the search is run. A conflict occurs if a second search is run while a previous search still has a result set open and is returning results. What I'd like to do in this case is simply create and execute a new statement rather than reusing the open one.
Is there a way to determine if PDOStatement has had closeCursor()
called on it or that all records have been fetched?
Alternatively, how can I determine if more results are available in a PDOStatement without advancing past the next result?