title: mysql_close(): supplied argument is not a valid MySQL-Link resource
body: <p>Here's what I'm trying to do: I've got a db.php file that does all the db manipulation.</p>
  
  <p>It has 2 static methods, connect and deconnect.</p>
  
  <p>In my other file i simply use db::connect() and db::deconnect(). The mysql_close($con) in the deconnect method just doesn't know who $con is. </p>
  
  <p>Since I don't want to instantiate my class static is the only way to go.</p>
  
  <p>Declaring 'private $con' in class db doesn't seem to have an effect.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>class db {
  
      public static function connect() {
          $dbData = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/config.ini');
  
          $con = mysql_connect($dbData['host'],$dbData['user'],$dbData['pass']);
          $db = mysql_select_db($dbData['db']);
          if ((!$con) || (!$db))
              return 0;
          else return 1;
      }
  
      public static function deconnect() {
          mysql_close($con);
      }
  
  }
  </code></pre>