A Database Error Occurred

Error Number: 1064

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 '-9,1' at line 10

SELECT images.imageID, images.rallyID, images.collectionID, (@num:=@num-1) AS EngineURLCounter FROM images LEFT JOIN events ON images.rallyID = events.rallyID WHERE engineID = 689 ORDER BY images.imageDateTime DESC, images.imageID DESC LIMIT -9,1

Filename: views/front/picture-viewer.php

Line Number: 65