Re: Critical error Re: Critical error
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Re: Critical error

Started by carolusabe, March 13, 2014, 08:05:50 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

carolusabe

Hi, i have an error like that, is not exactly the same but i read the rules and i think i don't need to create another topic. I read all your posts but the error continues when i want to go to an specific category:

QuoteCritical error: There was an error while processing a database query.

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 cpg15x3_albums AS a  LEFT JOIN cpg15x3_pictures AS p ON a.thumb=p.pid  WHERE a.category = 7   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

Gallery: http://merlinspain.com/galeria

I've looking solutions here but nothing works. Maybe you can help me if you please.
Thank you so much,
Carola


gmc

First you are running 1.5.10 which is over 3 years old:
2010-11-30 [M] Release of cpg1.5.10
There are many fixes and security issues between 1.5.10 and 1.5.26.

Looking at index.php for 1.5.10 - I see a similar query on line 771 (your message indicated 778)...
(SQL starts at line 766, issued at 771 - the last line I quoted)

    $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 a.pos, a.aid ' . $limit;
        $alb_thumbs_q = cpg_db_query($sql);

The ORDER BY criteria is hardcoded (not a variable) so don't know why that would be missing?

Have you made any modifications in this area?  or recently that could have changed things?
Can you post the code you have just above line 778?

Thanks!
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

carolusabe

QuoteFirst you are running 1.5.10 which is over 3 years old
How is that possible? I downloaded the latest version here:http://coppermine-gallery.net

QuoteHave you made any modifications in this area?  or recently that could have changed things?
No i haven't made any modifications.

QuoteCan you post the code you have just above line 778?

        $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);
        $alb_thumbs = cpg_db_fetch_rowset($alb_thumbs_q);
        mysql_free_result($alb_thumbs_q);


Thank you so much for your reply!

gmc

#3
Strange that your page source says 1.5.10 (view page source and scroll to bottom... gives a commented eyecatcher of code level) but the failing code is in 1.5.26...

It does appear you are missing some config values in your database...
Appears the cpg_config table is at least missing a value for ''album_sort_order".
$sort_order is blank causing the error (no field listed in ORDER BY) which is set just above the failing code to:
$sort_order = $sort_array[$CONFIG['album_sort_order']];

You can run the same queries from André's post from January 28, 2014, 05:57:40 AM above...
You will need to change "cpg15x_" to your cpg table prefix.
Any INSERTS already there will tell you its a duplicate key... Any missing values will be added.

Post your results and we'll go from there...

Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

phill104

I am guessing some of the files were not uploaded correctly. If you go to http://merlinspain.com/galeria/sql/update.sql you can clearly see that file is from 1.5.10

Please download a fresh copy and follow the upgrade procedure as outlined in the docs making sure you run update.php at the end.
It is a mistake to think you can solve any major problems just with potatoes.

Αndré


carolusabe

I upgraded the gallery with a fresh copy and now it works. Thank you so much for your replies :)

gmc

You're welcome.
Please mark the topic 'solved' using the button at bottom left of page.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money