Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Critical Error  (Read 4954 times)

0 Members and 1 Guest are viewing this topic.

strokesfan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Critical Error
« on: May 11, 2014, 06:30:46 am »

For some reason when I go to the 2nd level categories I get a critical error -
There was an error while processing a database query. When I put it on debug mode it says this:

-----
While executing query 'SELECT a.aid, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner  FROM cpg_albums AS a  LEFT JOIN cpg_pictures AS p ON a.thumb=p.pid  WHERE a.category = 37   ORDER BY  LIMIT 0,1' in index.php on line 778

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

File: /home/public_html/pictures/include/functions.inc.php - Line: 272
------

Thanks for any help you can give me!
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Critical Error
« Reply #1 on: May 12, 2014, 08:06:40 pm »

The error is because their is no specification for the 'ORDER BY'... should be between the 'ORDER BY' and the 'LIMIT 0,1' - so a variable isn't properly populated...

You didn't proved a link to your gallery - nor the version/release you are running - so it is difficult to diagnose.
V1.5.28 does not contain the failing SQL statement on line 778.

Similar SQL is constructed beginning on line 714 and executed on line 731:
Code: [Select]
        $sort_array = array(
            'ta' => "a.title ASC, a.aid ASC",
            'td' => "a.title DESC, a.aid DESC",
            'da' => "a.aid ASC",
            'dd' => "a.aid DESC",
            'pa' => "a.pos ASC, a.aid ASC",
            'pd' => "a.pos DESC, a.aid DESC",
        );
        //$sort_code  = isset($USER['sort'])? $USER['sort'] : $CONFIG['album_sort_order'];
        //$sort_order = isset($sort_array[$sort_code]) ? $sort_array[$sort_code] : $sort_array[$CONFIG['album_sort_order']];
        $sort_order = $sort_array[$CONFIG['album_sort_order']];

        $sql = "SELECT a.aid, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner "
            . " FROM {$CONFIG['TABLE_ALBUMS']} AS a "
            . " LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON a.thumb=p.pid "
            . " WHERE a.category = $cat $album_filter "
            . " ORDER BY $sort_order $limit";
        $alb_thumbs_q = cpg_db_query($sql);

Please provide a link and/or the version release so I can confirm the statement...
Also what value is saved in you cpg_config table with name field of 'album_sort_order'?

From a tool like phpMyAdmin, you can issue SQL:
Code: [Select]
SELECT * from `cpg_config` WHERE `name` = 'album_sort_order'
Please post results...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

strokesfan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Critical Error
« Reply #2 on: May 15, 2014, 06:54:37 am »

Thanks! Here is my gallery - http://jessicaalbafan.com/pictures/index.php?cat=31

I put it in debug so you can see the error. Thanks again!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical Error
« Reply #3 on: May 16, 2014, 11:20:40 am »

Please upgrade to cpg 1.5.28 and don't forget to run update.php.
Logged

jipjip

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Critical Error
« Reply #4 on: August 25, 2014, 12:39:40 am »

I have same error was installed by 1nd1 autoinstaller

http://hotcelebs.co.uk/index.php?cat=2&page=2
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical Error
« Reply #5 on: August 25, 2014, 10:26:35 am »

installed by 1nd1 autoinstaller
http://documentation.coppermine-gallery.net/en/auto-installers.htm


Quote
<!--Coppermine Photo Gallery 1.5.24 (stable)-->
Please upgrade to the latest stable release (currently cpg 1.5.30) and don't forget to run update.php.
Logged

jipjip

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Critical Error
« Reply #6 on: August 25, 2014, 11:26:52 am »

Should I down latest version, remove auto installed version and, install it myself?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical Error
« Reply #7 on: August 25, 2014, 11:33:48 am »

Just follow our upgrade docs.
Logged
Pages: [1]   Go Up
 

Page created in 0.045 seconds with 19 queries.