db_smartone = $this->load->database("onedev", true); } function list() { $sql = "select * from m_religion"; $qry = $this->db_smartone->query($sql); if ($qry) { $rows = $qry->result_array(); echo json_encode($rows); } else { echo json_encode(array()); } } function get($id) { $sql = "select * from m_religion where M_ReligionID=?"; $qry = $this->db_smartone->query($sql,$id); if ($qry) { $rows = $qry->result_array(); echo json_encode($rows); } else { echo json_encode(array()); } } } ?>