title: MySQL connection error: resource(2) of type (mysql link)
body: <p>I have this problem:</p>
  
  <pre><code> &lt;?php
     $link = mysql_connect('123.123.123.123', 'user', 'pass');
     if (!$link) {
        die('con_error: ' . mysql_error());
      }
     mysql_select_db('db', $link) or die(mysql_error());
  
     echo 'connect!'."\n\n";
  
     var_dump($link);
     //var_dump($link-&gt;mysql_query('SELECT * FROM table LIMIT 1'));
     mysql_close($link);
     exit();
     ?&gt;
  </code></pre>
  
  <p>There are no errors and print "connect!". But then, i can't select anything - i get this error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function mysql_query() on a non-object i</p>
  </blockquote>
  
  <p><code>var_dump($link)</code> prints <code>resource(2) of type (mysql link)</code> and i cant find what does it means!</p>
  
  <p>All connection attributes are correct. I can connect to DB from command line...
  What should i do?</p>