using BETWEEN in WHERE condition

前端 未结 6 1916
萌比男神i
萌比男神i 2020-12-09 04:26

I\'d like the following function to select hotels with an accomodation between a certain $minvalue and $maxvalue. What would be the best way to do

6条回答
  •  青春惊慌失措
    2020-12-09 04:52

    In Codeigniter This is simple Way to check between two date records ...

    $start_date='2016-01-01';
    $end_date='2016-01-31';
    
    $this->db->where('date BETWEEN "'. date('Y-m-d', strtotime($start_date)). '" and "'. date('Y-m-d', strtotime($end_date)).'"');
    

提交回复
热议问题