title: mysql_error strange behavior (return always empty string)
body: <p>I'm getting this strange behavior:</p>
  
  <p>Imagine you have a class that simply creates a connection to MySQL and returns the connection link.</p>
  
  <pre><code>class Connection {
  
      private $conn;
      public function __construct() {
          $this-&gt;conn = mysql_connect(.....);
      }
      public function getConn() {
          return $this-&gt;conn;
      }   
  
  }
  </code></pre>
  
  <p>Now, if I try to use the connection link (of course instantiating Connection and using <code>$instance-&gt;getConn()</code>), I can use the link in the <code>mysql_query</code> function, but I cannot use it in <code>mysql_error</code> and <code>mysql_errno</code> (they always return respectively <code>''</code> and <code>0</code>, even if the query executed is absolutely wrong).</p>
  
  <p>But!! If I place the link creation in the same class of the <code>mysql_query</code>, <code>mysql_errno</code> and <code>mysql_error</code>, all works perfectly!!</p>
  
  <p>Has anyone had the same problem?</p>