title: PHP MySQLi Fatal error: Call to a member function fetch_array() on a non-object in
body: <p>Getting this error and not sure what's going on. New to using mysqli.</p>
  
  <pre><code>$query = 'SELECT name, email FROM US__users WHERE state="' . $state . '" ORDER BY zip ASC LIMIT 5';
  $result = $mysqli-&gt;query($query);
  
  while ($row = $result-&gt;fetch_array()) {
    print ($row['name'] . ' ' . $row['email']);
  }
  
  $result-&gt;free();
  </code></pre>
  
  <p>There's currently only one row in MySQL DB. However, when I copy the $query and run it at the mysql command prompt, it queries fine and displays one result.</p>