coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: djfunk on April 01, 2005, 10:17:08 PM

Title: There was an error while processing a database query
Post by: djfunk on April 01, 2005, 10:17:08 PM
hi guys I have been having a version of coppermine photo gallery ( I dont remembere the version) for one year now, but yesterday I got this message "There was an error while processing a database query " when I try to get into the gallery http://lnx.eventidivertenti.it/gallery/index.php
It has been everything ok up to yesterday but now I dont know what happening, I hope that somebody can help me 
PLEASE................
Title: Re: There was an error while processing a database query
Post by: Nibbler on April 01, 2005, 10:28:27 PM
You need to enable debug mode, and then post the actual mysql error message you get.  If you can't get to your config section, you'll  have to use phpMyAdmin to change the cpgxxx_config table entry "debug_mode" from 0 to 1.
Title: Re: There was an error while processing a database query
Post by: djfunk on April 02, 2005, 03:12:00 PM
hi nibbler thanks for your prompt response, I go to phpmyadmin and i go on cpgxxx_config to edit debug_mode. I enter the value 1 and press enter but I get an error message like this "#1044 - Access denied for user: 'Sql38242@%' to database 'Sql38242_1' "
The value of the debug mode is always 0
Do you have any suggestions?
Title: Re: There was an error while processing a database query
Post by: Nibbler on April 02, 2005, 03:15:22 PM
If your database username does not have the neccessary permissions to update your database you would need to resolve that with your host.
Title: Re: There was an error while processing a database query
Post by: djfunk on April 02, 2005, 03:31:07 PM
cheers mate i will try to contact them
see ya
Title: Re: There was an error while processing a database query
Post by: mrdavis494 on April 22, 2005, 03:09:44 AM
I suddenly started getting the same error - after turning on debug mode I found out what was wrong.

The directory I had my pictures in had a single quote (') in the directory name.  I had recently turned on "Display EXIF info" setting and completely forgot.

Anyway - I was getting an INSERT error when I would look at a picture in the offending directory - turns out - I have 60+ directories with single quotes - shame on me.

I modified 2 lines in /include/exif_php.inc.php, adding single quotes inside the double quotes - see the diff output below:

me@myserver:/var/www/html/familypics/include# diff exif_php.inc.php-orig exif_php.inc.php
31c31
<                   "WHERE filename = \"$filename\"";
---
>                   "WHERE filename = \"'$filename'\"";
82c82
<                   "VALUES ('$filename', '".addslashes(serialize($exifParsed))."')";
---
>                   "VALUES (\"'$filename'\", '".addslashes(serialize($exifParsed))."')";
me@myserver:/var/www/html/familypics/include#