Album - Most viewed - Critical error Album - Most viewed - Critical error
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Album - Most viewed - Critical error

Started by pavelh, July 19, 2010, 10:27:28 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

pavelh

Hello,
in my photogallery, in some albums: if I open the album and click to most viewed and then click to thumbnail, the critical error is displayed.

http://www.klatovy.net/fotogalerie/thumbnails.php?album=topn&cat=-2504

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 foto_pictures AS r
                INNER JOIN foto_albums AS a ON a.aid = r.aid
                WHERE (r.aid = 2504)
                AND approved = 'YES'
                AND hits > 0
                ORDER BY hits ASC, pid DESC
                 LIMIT 0 ,-186' 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 '-186' at line 8


I would guess - there could be a missing apostrophe in this line: LIMIT 0 ,-186'

If I displayed most viewed pictures in category, error is not displayed. Only in album.

Thanx, Pavel.

Αndré


jay4499

Quote from: Αndré on July 19, 2010, 12:18:28 PM
Already fixed in svn. See that topic.

I'm having the same problem and clicked on your link but don't see any solution to the problem.  Any help would be appreciated. 

Αndré



Αndré


KB.cpg

Quote from: Αndré on July 19, 2010, 12:18:28 PM
Already fixed in svn. See that topic.
I have latest coppermine installed:
   Coppermine version: 1.5.16
   $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/include/functions.inc.php $
   $Revision: 8243 $

But still have same problem - negative limits in SQL like this: ORDER BY r.pid ASC LIMIT 0 ,-231
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
FROM cpg_pictures AS r
INNER JOIN cpg_albums AS a ON a.aid = r.aid
WHERE (category = 14715) AND r.aid NOT IN (193, 301, 161, 114, 386, 53, 64, 86, 85, 91, 93, 94, 96, 97, 84, 121, 105, 108, 141, 143, 40, 196, 198, 203, 206, 217, 220, 20, 232, 236, 242, 271, 252, 253, 255, 258, 272, 285, 289, 295, 345, 207, 224, 259, 291, 584, 378, 411, 442, 732, 444, 456, 470, 590, 492, 493, 494, 502, 521, 535, 538, 550, 556, 569, 580, 592, 596, 598, 601, 638, 645, 648, 654, 693, 666, 677, 695, 698, 700, 701, 703, 705, 706, 707, 708, 709, 710, 711, 715, 725, 726, 727, 731)
AND approved = 'YES'
ORDER BY r.pid ASC  LIMIT 0 ,-231' in include/functions.inc.php on line 1501 the following error was encountered:
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 '-231' at line 6

How fix it?
Thank you

Αndré

KB.cpg, please start a new thread that contains more information. E.g. we need a link to your gallery and an explanation where the occurs exactly. It seems that the 'lastup' meta album is affected in your case, which differs from the initial error.


Closing.