Storing orders in database