I've upgraded my galleries to 1.5.6 (from an older 1.4 version). This appears to have gone smoothly but I'm seeing some errors when it comes to the most viewed functionality.
When viewing a gallery and sorting by most viewed and then trying to view an image the below errors are seen (these are two instances from separate galleries). It doesn't appear to effect all albums. I have test added a new album to one of the galleries and the error is seen.
I'm also seeing that when the same method is used (open album, switch to most viewed and then try and view an image) on some albums the wrong image is displayed (so you get a different image to the thumbnail when you click on it.
Any suggestions on what might be causing the issue and how to resolve it?
While executing query 'SELECT r.pid, r.aid, filepath, filename, url_prefix, pwidth, pheight, filesize, ctime, r.title, r.keywords, r.votes, pic_rating, hits, caption, r.owner_id, pic_raw_ip, pic_hdr_ip
FROM cpg1411_pictures AS r
INNER JOIN cpg1411_albums AS a ON a.aid = r.aid
WHERE (r.aid = 834)
AND approved = 'YES'
AND hits > 0
ORDER BY hits ASC, pid DESC
LIMIT 0 ,-2818' in include/functions.inc.php on line 1593
mySQL error: 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 '-2818' at line 8
File: include/functions.inc.php - Line: 258
While executing query 'SELECT r.pid, r.aid, filepath, filename, url_prefix, pwidth, pheight, filesize, ctime, r.title, r.keywords, r.votes, pic_rating, hits, caption, r.owner_id, pic_raw_ip, pic_hdr_ip
FROM cpg1410_pictures AS r
INNER JOIN cpg1410_albums AS a ON a.aid = r.aid
WHERE (r.aid = 205)
AND approved = 'YES'
AND hits > 0
ORDER BY hits ASC, pid DESC
LIMIT 0 ,-2' in include/functions.inc.php on line 1593
mySQL error: 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 '-2' at line 8