I am halfway through making a MySQL class to interface with the db and be shiny and stuff but i am unable to understand an error i get. PHP: class mysqlClass{ var $queryres; #used to return the results of a query var $result; #used to store the results of a query var $numrows; #used to store the number of rows var $connection; #used as a connection reference function mysqlClass($details){ $this->user['host'] = $details['host']; $this->user['user'] = $details['user']; $this->user['pass'] = $details['pass']; $this->user['db'] = $details['db']; $this->connection = @mysql_connect($this->user['host'], $this->user['user'], $this->user['pass']) || die("Connect error"); #connect to mySQL $this->selectDatabase($this->user['db'], $this->connection); #select appropriate db } function selectDatabase($database){ @mysql_select_db($database) || die ("Db select error"); } function closeConnection(){ mysql_close($this->connection); } //more functions here. } If i use that to make an object like $conn = new mysqlClass($array); it connects, and selects the database fine. If i then call $conn->closeConnection(); i get the error Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource, and cannot understand why. Any help would be usefull Col
lol, thought this looked a bit familiar. Have already replied on Xaprief. PS - Someone else that uses #comments - woo. Don't seem to see many of them.