Advanced search  

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

Pages: [1]   Go Down

Author Topic: Database Query error  (Read 4261 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Database Query error
« on: April 07, 2011, 11:38:31 pm »

Hey Folks,

I suspect this is a server-side error, not a coppermine error, but wanted to verify it. I'm getting this error on SOME files:

Code: [Select]
While executing query 'SELECT cid FROM CPG_categories WHERE lft BETWEEN  AND ' in include/functions.inc.php on line 54

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 'AND' at line 1

From this gallery the first thumbnail on the page gives this error:

see here

However .. if I search by filename, I can access the file:

http://www.skolaiimages.com/stock/thumbnails.php?search=09_SEP3684.jpg&submit=search&album=search&title=on&newer_than=&caption=on&older_than=&keywords=on&filename=on&type=AND

That search gives me the thumbnail, and I can click on it and open the image just fine:

http://www.skolaiimages.com/stock/displayimage-search-0-5883-2-Grizzly-bear-cubs-Ursus-arctos-Katmai-Na.html

I've contacted my webhost, but want to make sure this isn't a function of some of the recent changes I've had made to the coppermine files first.

Thank you.

Cheers

Carl
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Database Query error
« Reply #1 on: April 08, 2011, 08:53:04 am »

Please disable the sef_url plugin, as I assume the starting digit of the title confuses the plugin. If I manually remove it from the url, it works as expected:
Quote from: error
http://www.skolaiimages.com/stock/displayimage-93-5883-2-Grizzly-bear-cubs-Ursus-arctos-Katmai-Na.html
Quote from: works
http://www.skolaiimages.com/stock/displayimage-93-5883--Grizzly-bear-cubs-Ursus-arctos-Katmai-Na.html
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Database Query error
« Reply #2 on: April 08, 2011, 08:28:15 pm »

Hey André

Ahh, that's it, thank you. I just removed the character "2" from the title and now it works fine. I'll just make sure I don't have any titles start with a number and hopefully have no more problems with it.

Thank you.

Cheers

Carl
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.