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: Query ERROR after upgrade MYSQL 4 to version 5  (Read 9607 times)

0 Members and 1 Guest are viewing this topic.

Perry

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Query ERROR after upgrade MYSQL 4 to version 5
« on: February 21, 2008, 12:22:36 pm »

Hi All,

My hosting company has upgraded MYSQL from version 4 to version 5 today. After the upgrade I get the following error:

While executing query "SELECT *, a.title as album_name, p.filename as filename FROM cpg132_pictures as p, cpg132_albums as a LEFT JOIN cpg132_exif as e ON concat('albums/',p.filepath,p.filename) = e.filename WHERE p.aid = a.aid AND approved = 'YES'ORDER BY pid DESC  LIMIT 0 ,6" on 0

mySQL error: Unknown column 'p.filepath' in 'on clause'

I have no idea what to do. I hope someone can help me with this problem.

Perry
Logged

Nibbler

  • Guest
Re: Query ERROR after upgrade MYSQL 4 to version 5
« Reply #1 on: February 21, 2008, 12:47:52 pm »

I'm pretty sure that's not a normal Coppermine query in the first place. What mod or plugin is this?
Logged

Perry

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Query ERROR after upgrade MYSQL 4 to version 5
« Reply #2 on: February 21, 2008, 12:58:04 pm »

This is the query on line 112 in the function.php

$result = db_query("SELECT *, a.title as album_name, p.filename as filename FROM {$CONFIG['TABLE_PICTURES']} as p, {$CONFIG['TABLE_ALBUMS']} as a LEFT JOIN {$CONFIG['TABLE_EXIF']} as e ON concat('{$CONFIG['fullpath']}',p.filepath,p.filename) = e.filename WHERE p.aid = a.aid AND approved = 'YES'" .str_replace("aid","p.aid",$ALBUM_SET)."ORDER BY pid DESC $limit");


Are you sure this is not an original query ?

If it is not, do you have any idea why this query is not woking with mysql 5.0 and was working with mysql 4.x.x

Perry
Logged

Nibbler

  • Guest
Re: Query ERROR after upgrade MYSQL 4 to version 5
« Reply #3 on: February 21, 2008, 01:27:09 pm »

Update your gallery. Coppermine 1.3 is no longer supported.
Logged

Perry

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Query ERROR after upgrade MYSQL 4 to version 5
« Reply #4 on: February 21, 2008, 01:29:11 pm »

Seems to have fixed this one.

There seems to have been a change for the JOIN query in MYSQL 5.0

Orginal:

$result = db_query("SELECT *, a.title as album_name, p.filename as filename FROM {$CONFIG['TABLE_PICTURES']} as p, {$CONFIG['TABLE_ALBUMS']} as a LEFT JOIN {$CONFIG['TABLE_EXIF']} as e ON concat('{$CONFIG['fullpath']}',p.filepath,p.filename) = e.filename WHERE p.aid = a.aid AND approved = 'YES'" .str_replace("aid","p.aid",$ALBUM_SET)."ORDER BY pid DESC $limit");

CHANGED INTO:

$result = db_query("SELECT *, a.title as album_name, p.filename as filename FROM ({$CONFIG['TABLE_PICTURES']} as p, {$CONFIG['TABLE_ALBUMS']} as a ) LEFT JOIN {$CONFIG['TABLE_EXIF']} as e ON concat('{$CONFIG['fullpath']}',p.filepath,p.filename) = e.filename WHERE p.aid = a.aid AND approved = 'YES'" .str_replace("aid","p.aid",$ALBUM_SET)."ORDER BY pid DESC $limit");

See the bold ( and ). Works fine now
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Query ERROR after upgrade MYSQL 4 to version 5
« Reply #5 on: February 21, 2008, 05:36:45 pm »

Moving to outdated cpg1.3.x support board. Don't!
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.