This looks to be an inefficient way to do what you are trying to do.
looks like $_POST['giftWrapId'] contains the ID for the record you want to return.
why not just create a recordset that uses $_POST['giftWrapId'] as the filter to return the record you want.