lak Posted November 26, 2011 Share Posted November 26, 2011 In MySQL this would read as SELECT * FROM querydate WHERE dateposted >= ( SELECT SUBDATE( CURRENT_DATE, INTERVAL 14 DAY ) AS LASTDATE ) AND dateposted <= CURRENT_DATE Returning records that are NOT more than 14 days from current date so if i do this in CI2 $lastdate=$this->db->query(SELECT SUBDATE( CURRENT_DATE, INTERVAL 14 DAY ) AS LASTDATE ); $currdate=$this->db->query(SELECT CURRENT_DATE AS CURRDATE); $this->db->select(); $this->db->get(querydate); $this->db->where('dateposted=>',$lastdate); $this->db->where('dateposted<=',$currdate); Any MASTER JEDI who can confirm that this absolutely theoritically CORRECT? Many thanks. Link to comment https://forums.phpfreaks.com/topic/251828-ci2-active-record-class-return-recordsets-using-mysql-functions/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.