You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND UploadSession=0 ORDER BY IDUpload ASC' at line 5
SELECT * FROM eventhr.urz_upload WHERE UplTabelaID=253 AND UplDocumentID= AND UploadSession=0 ORDER BY IDUpload ASC