there is a mysql function in php called mysql_free_result(); I couln't find any similar function for PDO.
is there a pdo function to free the result of a database fetch or does the result set automatically get requested and freed when I call $stmt->fetch()
data?
could someone explain me this difference between native mysql and pdo?
The mysqli_free_result() function frees the memory associated with the result.
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 statement in a state that enables it to be executed again.
Basically quote() is safe as prepared statements but it depends on the proper implementation of quote() and of course also on it's consequent usage. Additionally the implementation of the used database system/PDO driver has to be taken into account in order to answer the question.
PDO: Python Database Objects, is a collection of objects for use with Phase or with the Python Programing Language. PDO is designed to be robust and simple at the same time, allowing access to multiple styles of databases, with one set of instructions.
closest method is close cursor for PDO statements.
http://us.php.net/manual/en/pdostatement.closecursor.php
$stmt = $dbh->prepare('SELECT foo FROM bar'); $stmt->closeCursor();
You can set the object variable to null. The GC will destroy the PDO Statement instance, I guess.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With