[eluser]hugle[/eluser]
Hello Everyone,
I'm trying to grab data, from database, which is older than 30 days:
I'll paste the live example, so it would be easier to understand...
Code:
$this->db->select('`favorites`.*, `razrabotki`.`name` AS `name`, `razrabotki`.`text` AS `text`, `razrabotki`.`created` AS `created2`');
$this->db->where(array('user_id' => $this->user_id, 'class_id' => '3'));
//$this->db->where('DATE_SUB(CURDATE(),INTERVAL 30 DAY) > `created2`');
$this->db->join('users', 'users.id = favorites.user_id', 'left');
$this->db->join('razrabotki', 'razrabotki.id = favorites.item_id', 'left');
$this->db->order_by("favorites.id", "desc");
$out = $this->db->get($this->_table)->result_array();
as you noted, the line #3 is commented out, since if I activate it, I get MySQL errors...
maybe this line $this->db->where('DATE_SUB(CURDATE(),INTERVAL 30 DAY) > `created2`')
should be described somehow in other way? I've already tried differend approaches... but with no luck
Maybe you guys could point me on direction?
I like ActiveRecord style so much!
THank you!