title: How to construct this query to show first the desired rows and then the rest?
body: <p>In my page I show some entries based on the range of the chosenTime a user chosen to get contacted, and saved it into mySQL.</p>
  
  <p>I have 4 range groups of times (our working times 09:00-17:00) that a user can select from</p>
  
  <pre><code>09:00 - 11:00
  11:00 - 13:00
  13:00 - 15:00
  15:00 - 17:00
  </code></pre>
  
  <p>For now, I show the results as below, order by the chosenTime</p>
  
  <pre><code>$sql = "SELECT * FROM table order by chosenTime asc";
  </code></pre>
  
  <p>What I want to do is to sort the results based on the current time.</p>
  
  <p>For example if time is 10:30, show first the rows that the chosen time is between 09:00-11:00. If it is 11:00, show first the 11:00 - 13:00 results.</p>
  
  <p>I am thinking about a between but I don't know on how to proceed with this.</p>
  
  <p>--<strong>What I did so far</strong>--</p>
  
  <p>My "dirty" try is this. Because it is hard to compare these data because of the format, I created a time like</p>
  
  <pre><code> $current = date("Hi", strtotime('+3 hours'));
  </code></pre>
  
  <p>so this gives me a <strong>1330</strong></p>
  
  <p>After this</p>
  
  <pre><code>if  ($current &lt; "1059")  { 
  
  show the results in the default way, chosenTime asc
  
  } else
  if (($current &gt;"1100") &amp;&amp; ($current &lt; "1259")) { 
  
  show the results starting with the ones that chosenTime="11:00 - 13:00" and then
   continue to the 13-15, 15-17, 09-11
  
  } else
  if (($current &gt;"1300") &amp;&amp; ($current &lt; "1459")) { 
  
  this follows the above example starting with chosenTime="13:00 - 15:00"
  
  } else
  if (($current &gt;"1500") &amp;&amp; ($current &lt; "1659")) { 
  
  this follows the above example starting with chosenTime="15:00 - 17:00"
  
  } 
  </code></pre>
  
  <p>The problem is how do I construct that query?</p>