Hello,
I'm building some database class, so i can reuse my code when using a not
mysql database system.
I'm implementing a free_result now;
some code of my class
class database
{
........
function free_result($result)
{
mysql_free_result($result);
return;
}
..............
}
?>
some of the code:
include ("class_mysql.php");
$db= new database();
$db->connect();
$result=$db->select_query("SELECT * FROM users");
echo mysql_num_rows($result);
$db->free_result($result);
echo mysql_num_rows($result);
Running this will give:
2 and "Warning: 2 is not a valid MySQL result resource"
So this seems to work, but why? Why is $result handled as it is a global
var?
I should think it must be something like:
function free_result(&$result)
{
mysql_free_result($result);
return;
}
But this don't work.
Thanks,
Bas
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]