title: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given
body: <p>The problem i'm having is from the 4th line of code listed below. I get an error that says </p>
  
  <blockquote>
    <p>Warning: <code>mysqli_fetch_array()</code> expects parameter 1 to be <code>mysqli_result</code>, <code>string</code> given</p>
  </blockquote>
  
  <p>I don't have the variable enclosed in <code>" "</code> or <code>' '</code> so I'm not sure where the string recognition is coming from at this point. Can tell me how to fix this error? </p>
  
  <pre><code>$query = "SELECT * FROM questions WHERE id='question' LIMIT 5";
  $result = mysqli_query($connection, $query);
  if($query === FALSE) { die(mysql_error()); } 
  
  while($row = mysqli_fetch_array($query)){
      $id = $row['id'];
      $thisQuestion = $row['question'];
      $question_id = $row['question_id'];
      $q = '&lt;h2&gt;'.$thisQuestion.'&lt;/h2&gt;';
      $query2 = "SELECT * FROM answers WHERE question_id='$question' ORDER BY rand() LIMIT 5";
      while($row2 = mysqli_fetch_array($query2)){
          //...
      }
  }
  </code></pre>