Fetch records between date range using codeigniter active record

Please find below the code to fetch all records between date range using codeigniter active record.


public function getAllDataBetweenDates($firstDate,$secondDate){
$this->db->where('date >=', $firstDate);
$this->db->where('date <=', $secondDate); return $this->db->get('your_table_name');
}

I am Hitesh from Jamshedpur (India). I have been working as a Web Application Developer from last 4+ years. I love diverse and attention catching web presence for a variety of users. Also I love to learn new things in Web Development.

Tags: