Critical Error - There was an error while processing a database query Critical Error - There was an error while processing a database query
 

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

Critical Error - There was an error while processing a database query

Started by kateheaven, January 05, 2011, 02:21:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kateheaven

I recently upgraded my Galleries from 1.4.27 to 1.5.10, and have since come across the following error on a few categories:

QuoteCritical Error
There was an error while processing a database query

This has happened on random categories - http://www.nkidman.com/gallery/index.php?cat=27 and http://www.isabellucasonline.org/gallery/index.php?cat=36 being two, although they are both fixed at the moment.

On http://www.isabellucasonline.org/gallery/index.php?cat=36 the error stopped showing after a little while and I was able to view the category. On http://www.nkidman.com/gallery/index.php?cat=27 I did some further research here and found someone mention a fix of disabling comment views below thumbnails. I tried that and the error message went away.

My question is, is it possible to allow the display of number of comments under thumbnails without getting this error? I couldn't find an answer to this here, but apologies if I have missed it. I'm also wondering if there's any other way I can prevent this error from occuring, seeing as it happened and then disappeared at http://www.isabellucasonline.org/gallery/index.php?cat=36 without me editing the comment thing etc.

Thanks for any help.

Αndré


kateheaven


Αndré

Of course you need to enable the settings where the error occurs ;) If you don't want to retain your gallery in that state, just enable the settings, copy the detailed error message to this thread and disable the settings.

kateheaven

Ah got it, oops!

At the moment it's only one category so I'll leave the debug and notices up for now: http://www.nkidman.com/gallery/index.php?cat=27

As I said, the error on http://www.isabellucasonline.org/gallery/index.php?cat=36 stopped showing by itself, so I can't do anything to get it up again for you to see the error notices.

Thanks

Αndré

It's very hard to debug that without access to your website.

Quoteinclude/functions.inc.php on line 2445
belongs to the function count_pic_comments, which is called inside function build_caption:
       if ($CONFIG['display_comment_count']) {
           $comments_nr = count_pic_comments($row['pid']);
           if ($comments_nr > 0) {
               $caption .= '<span class="thumb_num_comments">' . sprintf($lang_get_pic_data['n_comments'], $comments_nr) . '</span>';
           }
       }

which is called at several places at the code.


You can test several things:
1. disable the plugin engine, if you have installed some plugins
2. remove 'lastup' and 'random' from the content of the main page in Coppermine's config.
3. upload the theme 'curve' (you don't need to enable it, we can use that theme by adding the parameter ?theme=curve to the address bar)

kateheaven

Hello again,

I thought the error had stopped, but it appears not. I hope it's ok to bring this thread up again.

Doing the things you suggested:

1. I have disabled all plugins at http://www.nkidman.com/gallery/

2. I have removed 'lastup,1/random,1/onlinestats' from the 'The content of the main page'

3. 'curve' theme has been uploaded

All at http://www.nkidman.com/gallery/

Let me know if you need more info.

Thanks in advance for any further help...

Αndré

Quote from: kateheaven on May 02, 2011, 02:42:34 PM
1. I have disabled all plugins at http://www.nkidman.com/gallery/

2. I have removed 'lastup,1/random,1/onlinestats' from the 'The content of the main page'

3. 'curve' theme has been uploaded
Does the error still occur? If yes, where/when? I had a (very) short look at your gallery and it seems to work as expected.

kateheaven


Joe Carver

Something might be wrong with your theme.
The page source of your login page shows:
Quote<!--Coppermine Photo Gallery 1.5.12 (stable)-->
</body>
</html>

 
<!--Coppermine Photo Gallery 1.5.12 (stable)-->
</body>
</html>
Which does not look right.

Try using:
http://www.nkidman.com/gallery/index.php?theme=curve  
for a test
------------Edit
I looked at your site with Curve and that is not the problem - the theme will need to be fixed eventually...

Set Config >> Thumbnail view >> Display number of comments below the thumbnail to off (unchecked) for a test.
And also check your db for errors - backup and repair if needed.
------------/Edit

Αndré

If I remember right that error occurs if you've setup an album thumbnail that doesn't exist anymore. Try to update all album's thumbnails in that category.