title: Selecting time-based data
body: <p>What I am trying to achieve is grab data from the database, depending on the time.</p>
  
  <p>For example, I may have multiple <code>prices</code> for an item, and I would like the new price to be effective based on the time and date. So I can schedule price changes in advance.</p>
  
  <pre><code>id   link_id   datetime               price
  -------------------------------------------
  2    11        2016-11-03 00:00:00    1020
  3    11        2016-11-03 01:00:00    1050
  4    11        2016-11-03 03:00:00    1090
  </code></pre>
  
  <p>Let's say the time is <code>2016-11-03 00:59:00</code>, when a user queries the db they will se the <code>price-1020</code>. But when they query the db a minute later at <code>2016-11-03 01:00:00</code> they should get <code>price-1050</code>.</p>
  
  <p>Have tried this <code>WHERE datetime &lt; UTC_TIMESTAMP()</code>, however this does not solve my problem. Also it only needs to select one entry, this selects multiple.</p>
  
  <p>Is there a way MySQLi can do this?</p>