title: Yii Searing and Sorting time slots from A table
body: <p>I am working on an Web App using Yii framework, In a form I give two times as input and  in the controller I should search for the available time slots between the  start time and the end time from another table which has all the 5 minutes interval time slots and here is my code which gets SQL error   </p>
  
  <pre><code>                     $st = $_POST['Slots']['start_time'];
                      $et = $_POST['Slots']['end_time'];                         
                     $resslots = DoctorTimeSlots::model()-&gt;findAllByAttributes(
                              array(), 
                              "time_slots &lt; $et AND &gt;=$st", 
                              array('time_slots'=&gt;time('H:i:s')));
  </code></pre>