Critical error - Sql syntax Critical error - Sql syntax
 

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

Critical error - Sql syntax

Started by dj_jojo, November 16, 2005, 04:13:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dj_jojo

when i try to select a category to show albums the gallery returns critical error :S

QuoteWhile executing query "SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg134_albums as a LEFT JOIN cpg134_pictures as p ON a.thumb=p.pid WHERE category=8 ORDER BY a.posLIMIT 0,1" on 0

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

any suggestions and help.
Regards
D.

Abbas Ali

The problem is

Quotea.posLIMIT
in the query. There should be a space between a.pos and LIMIT i.e. it should be

Quote
a.pos LIMIT

Did you modified any files? If so then correct the query in that file.
Chief Geek at Ranium Systems

dj_jojo

hmm.. no i have only changed some of the Language files..... i'll try to overwrite functions file.


do you have any clue about which file could be causing the error beside the functions file?


regards
Dragan

Nibbler

It's in index.php here:


    $sql = 'SELECT a.aid, a.title, a.description, visibility, filepath, '.
           'filename, url_prefix, pwidth, pheight '.
           'FROM '.$CONFIG['TABLE_ALBUMS'].' as a '.
           'LEFT JOIN '.$CONFIG['TABLE_PICTURES'].' as p '.
           'ON a.thumb=p.pid '.
           'WHERE category='.$cat.$album_filter.
           ' ORDER BY a.pos '.
           $limit;


Should be easy to fix, just add in a space.

dj_jojo

 ;D

well done boys  :o  ; you have both earned a bottle of beer  ;)

muchos gracias

Regards
D.