title: Group query doesn't value corresponding values
body: <p>I have a query which works alright in grouping from the highest order. What i've realized is its able to pick up the <code>ids</code> alright but the values of the <code>vmsg</code> field is not corresponding to that of the <code>id</code>. </p>
  
  <p>For example id of <code>28</code> corresponds with a <code>vsmg</code> 'hello' but after you run the query id of <code>28</code> picks a different value .</p>
  
  <p>This is how it looks from the backend</p>
  
  <p><a href="https://i.stack.imgur.com/lpfhR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lpfhR.jpg" alt="enter image description here"></a></p>
  
  <p>and with my script</p>
  
  <pre><code>SELECT 
      MAX(id) as id, vmsg, sender_id, fname, lname, profile_pix, profile.profile_id
  FROM 
      chats 
  LEFT JOIN 
      profile 
  ON 
      chats.sender_id = profile.profile_id
  WHERE 
      reciever_id = 1
  GROUP BY 
      (sender_id)
  </code></pre>
  
  <p>I get this :</p>
  
  <p><a href="https://i.stack.imgur.com/J1Q24.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J1Q24.jpg" alt="enter image description here"></a></p>
  
  <p>I get the max <code>ids</code> but the <code>vmsg</code> values don't correspond.</p>