php-pdo-mysql-helper-class icon indicating copy to clipboard operation
php-pdo-mysql-helper-class copied to clipboard

Just a question about closeCursor

Open petrospap opened this issue 7 years ago • 1 comments

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;
    }

petrospap avatar May 23 '17 13:05 petrospap

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

alaxcc avatar May 24 '17 09:05 alaxcc