Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord, MySQL with DATE_SUB ... how?
#3

[eluser]cahva[/eluser]
You dont actually have to use DATE_SUB at all. This is perfectly valid query:
Code:
SELECT CURDATE() - INTERVAL 31 DAY;

For the AR this should work:
Code:
$this->db->where('(CURDATE() - INTERVAL 31 day) > created2');

If the query fails, you can check the last query with
Code:
echo $this->db->last_query();


Messages In This Thread
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-04-2009, 11:12 AM
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-04-2009, 03:33 PM
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-04-2009, 04:20 PM
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-04-2009, 04:39 PM
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-04-2009, 04:44 PM
ActiveRecord, MySQL with DATE_SUB ... how? - by El Forum - 10-06-2009, 04:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB