title: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given on line 6
body: <pre><code>&lt;?php 
  if (isset($_GET['hash'])&amp;&amp;!empty($_GET['hash'])){
          $hash = $_GET['hash'];
          $message_query = "SELECT from_id, message FROM message WHERE hash='$hash'";
          $run_messages = mysqli_query($con,$message_query);
          while($row_messages = mysqli_fetch_array($con,$run_messages)){
               $form_id = $row_messages['from_id'];
               $message = $row_messages['message'];
  
               $user_query = "SELECT username FROM admins WHERE id='$from_id'";
               $run_user = mysqli_fetch_array($con,$user_query);
               $from_username = $run_user['username'];
  
               echo "&lt;p&gt;&lt;strong&gt;$from_username&lt;/strong&gt;&lt;/p&gt;&lt;/br&gt;";
          }
  }else{
      header('Location: messages.php');
  }
  ?&gt;
  </code></pre>
  
  <p>I'm getting this error message:</p>
  
  <blockquote>
    <p>Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result,
    object given on line 6</p>
  </blockquote>
  
  <p>Here's line 6 &amp; as you can see I have already included the <em>$con</em> which is my database connection.</p>
  
  <blockquote>
    <p>while($row_messages = mysqli_fetch_array($con,$run_messages)){</p>
  </blockquote>