title: mysql_fetch_array() expects parameter 1 to be resource, string given
body: <p>I have two classes <code>DBConn</code> and <code>DBQueries</code>. <code>DBQueries</code> inherits after <code>DBConn</code>. When I'm going to display all users in users database, I see message: <blockquote>mysql_fetch_array() expects parameter 1 to be resource, string given.</blockquote> Thanks for any suggestions.</p>
  <pre><code>class DBConn /*extends Config*/ {
    public function dbConnection(){
      $db_host = 'localhost';
      $db_login = 'root';
      $db_password = '';
      $db_name = &quot;database&quot;;
      $conn = mysql_connect($db_host, $db_login, $db_password);
      $db = mysql_select_db($db_name);
    }  
  }
  </code></pre>
  <pre><code>class DBQueries extends DBConn {
    function displayUsers(){
      $this-&gt;dbConnection();
      $query = &quot;SELECT * FROM users&quot;;
      $result = mysql_query($query);
      while ($row = mysql_fetch_array($query)) {
        echo $row['password'];
      }
    }
  }
  </code></pre>