update pdf and correct sql syntax