Fixed use of $id var should be $rating_id.