record to db