Codeigniter Query Builder - finding the number of records from a certain date not wor |
Within codeigntier, I have the following:
Code: echo $this->db->where('FROM_UNIXTIME(`last_login`) >=','NOW() - INTERVAL 1 DAY')->from('users')->count_all_results(); The above produces the result: 0 I used print_r($this->db->last_query()); to get the actual sql string being run and it is as follows: Code: SELECT COUNT( * ) AS `numrows` When I run it from with mysql, I get the correct result: 1. I am guessing that the escaping is now working or something but cannot figure it out. Any idea? |
Welcome Guest, Not a member yet? Register Sign In |