db_one = $this->load->database("onedev", true); } function config() { try { $sql = "select * from m_emailconfig from M_EmailConfigIsActive = 'Y' and M_EmailConfigType='R'"; $qry = $this->db_one->query($sql); $rows = $qry->result_array(); echo json_encode(rows); } catch(exception $e) { echo json_encode( array("status" => "ERR" , "message" => $e.message() ) ); } } }