php-pdo-mysql-helper-class
php-pdo-mysql-helper-class copied to clipboard
Just a question about closeCursor
hello
closeCursor is helpful to free memory or not?
i..e
public function fetch_single_row($table,$col,$val)
{
$nilai=array($val);
$sel = $this->pdo->prepare("SELECT * FROM $table WHERE $col=? LIMIT 1");
$sel->execute($nilai);
$sel->setFetchMode( PDO::FETCH_OBJ );
$obj = $sel->fetch();
$sel->closeCursor();
return $obj;
}
you can read follow links about that: http://www.php.net/manual/en/pdostatement.closecursor.php https://stackoverflow.com/questions/12843886/when-should-i-use-closecursor-for-pdo-statements