title: Sql group data by week date
body: <p>I have below table:</p>
  
  <pre><code>CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `due_date` date NOT NULL,
  PRIMARY KEY (id)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  INSERT INTO `test`(`id`, `title`, `due_date`) VALUES (1,'name1','2017-02-02');
  INSERT INTO `test`(`id`, `title`, `due_date`) VALUES (2,'name2','2017-06-01');
  INSERT INTO `test`(`id`, `title`, `due_date`) VALUES (3,'name3','2017-02-27');
  INSERT INTO `test`(`id`, `title`, `due_date`) VALUES (4,'name4','2017-03-10');
  INSERT INTO `test`(`id`, `title`, `due_date`) VALUES (5,'name5','2016-06-09');
  </code></pre>
  
  <p>And I have php code for print my data:</p>
  
  <pre><code>$database = new Database();
  $database-&gt;query("SELECT * from test");
  $database-&gt;execute();
  $arr = $database-&gt;resultset(); ?&gt;
  &lt;table&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;id&lt;/th&gt;
          &lt;th&gt;name&lt;/th&gt;
          &lt;th&gt;due_date&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;?php foreach ($arr as $row): array_map('htmlentities', $row); ?&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo implode('&lt;/td&gt;&lt;td&gt;', $row); ?&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;?php endforeach; ?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Now I print all rows. 
  I have due_date column, date format.
  How can I group my data for three catagorees: this week, next week and other week ( depends from due_date) .
  And do that my code print:</p>
  
  <pre><code>This week
  id name  due_date
  3  name3 2017-02-27
  Next week
  4  name4  2017-03-10
  Other week
  1 ...
  2 ...
  5 ...
  </code></pre>