I have a problem that i can't fix :(
Well, I have 2 dates and 2 times.
what I need? Show the more recent record, that
I tried with
start date >= date('Y-m-d') AND
finish date <= date('Y-m-d') AND
(start time) >= date('H:i:s') AND
end time <= date('H:i:s'))
order by ('finish date', 'desc');
In codeIgniter..
->where("start_date >= '{$today}' AND finish_date <= '{$today}'")
->where("start_time >= '{$time}' AND finish_time <= '{$time}'")
what i miss?
Thanks
I THINK that I fix it...
(start_date >= $today AND start_time <= $time) AND
(finish_date <= $today AND end_time >= $time)
Well, that works atm...
you need to change the active recods query from
$this->select(*)->from('table')->where("start_date >= '{$today}' AND finish_date <= '{$today}'")
->where("start_time >= '{$time}' AND finish_time <= '{$time}'")
to
$this->db->query("SELECT * FROM table WHERE start_date BETWEEN {$today} AND finish_date BETWEEN {$today} AND start_time BETWWEN {$time} AND finish_time BETWWEN {$time}");
return $this->db->get()->result();