PHP cannot mysql_close() because resource is null?
<p>I'm using a destructor to close the db connection. </p>

<pre><code>    function __destruct(){
        var_dump($this-&gt;dblink);
        mysql_close($this-&gt;dblink);
    }
</code></pre>

<p>var dump gives me</p>

<pre><code>resource(7) of type (mysql link) NULL 
</code></pre>

<p>and the mysql_close() gives me:</p>

<pre><code>Warning: mysql_close() expects parameter 1 to be resource, null given     
</code></pre>

<p>Any thoughts?</p>

<p><strong>EDIT</strong> 
Thanks to the replies I found the issue. destruct is being called by another parent class. Pretty obvious to me now.</p>

<p><strong>THANKS</strong></p>
