Codeigniter: how to get data between today and last 15 days from database
Use CodeIgniter standard of query
$this->db->select('*');
$this->db->where('date BETWEEN DATE_SUB(NOW(), INTERVAL 15 DAY) AND NOW()');
$this->db->where($conditions);
$result = $this->db->get($table);