When I create a function, like this, must I close the mysqli result set or is it closed automatically?
function return_true(){
$query_res = $database->query("SELECT * FROM balance_sheet_rows");
//some code here
return true;
}
On this case, do I need to do $query_res->close()
or is it closed automatically when a function returns the value?
There isn't duplicate question, because other pepole ask if it must close before a script ending. I ask if i must close before a function return a value !. When i have a function that execute a query, my var $res must be closed ? Documentation --> http://php.net/manual/en/mysqli-result.free.php