$id = $this->input->get('profile_id', TRUE); // Using CI ActiveRecord $qry = $this->db->where('id', $id)->get('some_table'); // Or...using my dbhelper lib $qry = $this->dbhelper->select_from_sometable_where_id($id)->execute();