How can I save a dbhandle in an object?
Posted: Sat Mar 19, 2005 6:24 pm
Hi everybody!
I want to save a dbhandle in an object. My first thought was:
But when I want to close the connection the following code produces an error.
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource
I don't get it?
var_dump() shows that the var dbh is a resource ???
Thanx for your help
I want to save a dbhandle in an object. My first thought was:
Code: Select all
$this->dbh = @mysql_connect($host, $user, $pw) or print mysql_error();Code: Select all
mysql_close($this->dbh)I don't get it?
var_dump() shows that the var dbh is a resource ???
Thanx for your help