title: sql - Show Event if date is between two dates Code Igniter
body: <p>I have an events table with fields:</p>
  
  <ul>
  <li>event_name</li>
  <li>start_date</li>
  <li>end_date</li>
  </ul>
  
  <p>I want to display the event if the date today is between the start_date and the end_date.</p>
  
  <p>And the start_date should be greater than today to display the current event.</p>
  
  <pre><code>$today = date("Y-m-d");
  $event = $this-&gt;db-&gt;where("start_date &gt;=",$today)
      -&gt;where("end_date &lt;=",$today)
      -&gt;order_by("from_date","asc")
      -&gt;get("events");
  </code></pre>
  
  <p>I have 2 sample events:</p>
  
  <pre><code>---event_name--------start_date--------end_date---
      event1         2016-01-19        2016-02-20
      event2         2016-02-29        2016-02-29
  </code></pre>
  
  <p>I want only to show the event that today date is between the start_date and end_date of the event. But one of the event keep showing.</p>
  
  <p>I have edited my question. The field should be start_date and end_date.</p>
  
  <p>Sorry.</p>