SELECT * FROM table WHERE 'created' = DATE_SUB('2010-01-01', INTERVAL 1 MONTH);
How can I accomplish this with DMZ?? I have tried with the ->where_func() method, but failed [/quote]
Because of the "INTERVAL 1 MONTH" not being a string, I can't make it work with the DMZ methods. However, there's no need to use the DMZ methods anyway, since it is all simple arguments. I'd just do this:
Code:
$o = new Object();
// you can use $o->db->escape() if the date is dynamic
$o->where('created', "DATE_SUB('2010-01-01', INTERVAL 1 MONTH)", FALSE);
$o->get();
(The real purpose of the *func methods is that it can automatically handle related fields.)