codeigniter db where between

$this->db->where('created_at >=', $start_date); $this->db->where('created_at <=', $end_date); $query = $this->db->get('your_table_name');

  1. Use the "$this->db->where" method to specify the condition "created_at >= start_date".
  2. Use the "$this->db->where" method again to specify the condition "created_at <= end_date".
  3. Execute the query using "$this->db->get('your_table_name')", which will retrieve the records from the specified table within the specified date range.