Sachin Parmar
Tue May 14 02:25:52 -0400 2013
please use following coding
Model::delete_all(array('conditions' => array('date < ? and category = ? ', '2012-01-01 00:00:00', 'journal')));
Just enjoy ;)
serg tch
Tue May 14 16:16:03 -0400 2013
It gives an error:
Fatal error: Uncaught exception 'ActiveRecord\ActiveRecordException' with message 'Call to undefined method: delete_all' ...............
Any ideas?
serg tch
Tue May 14 16:49:13 -0400 2013
Had to download the nightly build to work. For some reason this didn't work with the stable build.
Thank you!
serg tch
Tue May 14 19:32:10 -0400 2013
Any idea how to count how many were affected (deleted)?
(1-4/4)
Subject: mass delete
From this link http://www.phpactiverecord.xyz/projects/main/wiki/Basic_CRUD I got the following:
However, I need to delete from a table WHERE DATE is less than 2012-01-01 00:00:00 AND where CATEGORY equal to JOURNAL
The following code does NOT work:
If I leave:
it deletes only the WHERE category equals to journal. So my question is HOW can I implement COMPARISON operator into that query with the date?
I've already spent 3 days trying to figure that out and searching everywhere online with no luck. Would really appreciate your input! THANK YOU IN ADVANCE!!!