title: Grouping content in sql
body: <p>This is my sql database:</p>
  
  <p><br><br>
  <a href="https://i.stack.imgur.com/hq0Hd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hq0Hd.png" alt="enter image description here"></a></p>
  
  <p>I would like to group the messages based on the t0_id (4) and the from_id.
  The messages should be in groups of different from_id based on to_id of 4</p>
  
  <pre><code>That is get a php output of:
  1. get: TRUELOVE, hadi when(from_id is 1)
  2. get: cutie (from_id 2)
  3. get: true love(from_id 3)
  </code></pre>
  
  <p>NB: THE FROM_ID IS NOT CONSTANT VALUE BUT to_id IS CONSTANT (4)</p>
  
  <p>How can i write the sql statement</p>