title: SQL query returns incorrect value for ID column in PHP
body: <p>I am using the following SQL query to extract content from the tables <strong>posts</strong>, <strong>users</strong> and <strong>comments</strong></p>
  
  <p>When I run the query on the database it correctly returns the value of 14 for the 'ID' column in the result. </p>
  
  <p>However using PHP's mysqli it is returning <em>1</em> and sometimes <em>2</em>. Can anyone see any issues with the query? I've been staring at it for hours and I really don't want to do a separate query just to get the correct ID value.</p>
  
  <pre><code>SELECT * FROM posts 
  LEFT OUTER JOIN comments ON posts.ID = comments.comment_post_id AND comments.comment_approved = 1
  LEFT OUTER JOIN users ON users.ID = posts.post_author WHERE posts.ID = '14' AND posts.post_type = 'post' AND posts.post_status = 'publish'
  ORDER BY comments.comment_ID DESC 
  </code></pre>
  
  <p><strong>PHP Code:</strong></p>
  
  <pre><code> while ($thisResult = $result-&gt;fetch_array(MYSQLI_ASSOC)) {
      echo $thisResult['ID']; // returns 1
      echo $thisResult['post_title']; // returns the correct post title
   }
  </code></pre>