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!
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:
$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:
SELECT * from `cpg_config` WHERE `name` = 'album_sort_order'
Please post results...
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!
Please upgrade to cpg 1.5.28 and don't forget to run update.php (http://jessicaalbafan.com/pictures/update.php).
I have same error was installed by 1nd1 autoinstaller
http://hotcelebs.co.uk/index.php?cat=2&page=2
Quote from: jipjip on August 25, 2014, 12:39:40 AM
installed by 1nd1 autoinstaller
http://documentation.coppermine-gallery.net/en/auto-installers.htm
Quote<!--Coppermine Photo Gallery 1.5.24 (stable)-->
Please upgrade (http://documentation.coppermine-gallery.net/en/upgrading.htm) to the latest stable release (currently cpg 1.5.30) and don't forget to run update.php (http://hotcelebs.co.uk/update.php).
Should I down latest version, remove auto installed version and, install it myself?
Just follow our upgrade docs.