There is an error in the request where the condition is, check the condition inside one quotation mark and a comma after the condition and value, for the link and in this line $this->db->where('level=>', "5");you have a character >after the equal sign, it should be like >=or simple =, as shown below
$this->db->select('id');
$this->db->from('approval');
$this->db->where('level=', "5");
$this->db->where('date_and_time>=', "CURDATE() + INTERVAL 30 DAY");
$this->db->where('date_and_time<', "CURDATE() + INTERVAL 61 DAY");
$res=$this->db->get()->result_array();
source
share