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: Re: Critical error  (Read 3541 times)

0 Members and 1 Guest are viewing this topic.

carolusabe

  • Coppermine newbie
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 19
Re: Critical error
« on: March 13, 2014, 08:05:50 pm »

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:

Quote
Critical 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

Logged

gmc

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

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)
Code: [Select]
    $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!
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

carolusabe

  • Coppermine newbie
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 19
Re: Re: Critical error
« Reply #2 on: March 13, 2014, 11:51:10 pm »

Quote
First 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

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

Quote
Can you post the code you have just above line 778?

Code: [Select]
        $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!
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Re: Critical error
« Reply #3 on: March 14, 2014, 01:04:21 am »

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:
Code: [Select]
$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...

« Last Edit: March 14, 2014, 02:10:33 am by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Re: Critical error
« Reply #4 on: March 14, 2014, 08:34:03 am »

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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Critical error
« Reply #5 on: March 14, 2014, 09:22:39 am »

Logged

carolusabe

  • Coppermine newbie
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 19
Re: Critical error
« Reply #6 on: March 15, 2014, 01:30:42 am »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Critical error
« Reply #7 on: March 15, 2014, 02:13:39 am »

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

Page created in 0.026 seconds with 19 queries.