title: Call to a member function fetch_object() on a non-object
body: <p>When I load the PHP page containing the code below I get the error "Call to a member function fetch_object() on a non-object." It pertains to the line starting with the word while. Why is this error popping up? <b>Ignore my security weaknesses please.</b></p>
  
  <p>PHP snippet:</p>
  
  <pre><code>header('Content-Type:application/json;charset=utf-8');
  
  $file_absolute = "---placeholder for correct file path---";
  include_once($file_absolute);
  $mysql = new mysqli($db_host, $db_username, $db_password, $db_name);
  $verb_value = $_POST['verb_value'];
  
  $mysql-&gt;query("SET CHARACTER SET 'utf8'");
  
  $result = $mysql-&gt;query("SELECT present_tense FROM $verb_value");
  
  $queryResult = array();
  
  while ($row = $result-&gt;fetch_object())
  {
      $queryResult[] = $row-&gt;present_tense;
  }
  </code></pre>