Codeigniter Date comparison - Greater than or Less than datetime field not working
04:21 21 Feb 2019

I have the following queries in codeigniter to find any data in which the datetime field is more than 24 hours. Here is my try...

$this->db->where('date_reg >', 'DATE_SUB(NOW(), INTERVAL 1 DAY)');

But the above query is not working!

What I want in short is, return all rows which the date_reg is more than 24 hours...

I can not use query in codeigniter! Here is the format for date_reg field....2019-02-19 08:00:00

How do i do that?

php mysql datetime codeigniter activerecord