#!/usr/local/bin/php -q conn2 = mysql_connect('localhost:3306', 'levi', 'foobar'); mysql_select_db('surveytest', $this->conn2); } public function __destruct() { mysql_close($this->conn2); //$this->conn2 = null; } } $t = new Test(); $t = null; mysql_close($conn1); ?>