added some more PHP

added some more PHP to the logic returning the record ID of a new record