title: Show rows like timeline (Today, last day ...)
body: <p>I want show the rows of mysql table like this:</p>
  
  <pre><code>Today
  Row1
  Row2
  ....
  
  Last day
  Row1
  Row2
  ...
  
  Before last day
  Row1
  Row2
  ...
  </code></pre>
  
  <p>I have date column on my table: (id, message, date).</p>
  
  <p>What is the method to show the result like the example i given ?</p>
  
  <p>Here my approch in order to get the needed result:</p>
  
  <pre><code>$sql = $mysql-&gt;query("SELECT * FROM messages");
  $array = array();
  while($rows = mysql_fetch_array($sql)) {
    //Get proper date for array
    $key = date('Y-m-d', strtotime($rows["date"]));
  
    $arr[$key] = $rows["message"];
  
  }
  var_dump($array);
  </code></pre>
  
  <p>I want know if there a simple way to do it without array, or any other method.</p>
  
  <p>My problem is not based on how to get Today, Yesterday ... But on how to show the structure in the example that i given, and write for each date (Today, Yesterday ...) with a specific rows into the <code>while loop</code>.</p>