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: Database error  (Read 7259 times)

0 Members and 1 Guest are viewing this topic.

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Database error
« on: February 06, 2006, 02:47:25 pm »

Then I click to http://*********.com/index.php?cat=1 i get an error There was an error while processing a database query
I made some modifications before 2-3 weeks and now a user told me for this problem. I no other place there is no such an error.
Where to look for the problem :)
« Last Edit: February 12, 2006, 08:07:12 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Database error
« Reply #1 on: February 06, 2006, 02:52:25 pm »

Enable debug mode in config, navigate to the problem page and post the mysql error message that you get, not the entire debug output.
Logged

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Database error
« Reply #2 on: February 06, 2006, 04:47:44 pm »

While executing query "AND category >= 10000 GROUP BY user_id ORDER BY user_name" on 0

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 category >= 10000 GROUP BY user_id ORDER BY user_name' at line 1
Logged

Nibbler

  • Guest
Re: Database error
« Reply #3 on: February 06, 2006, 05:09:33 pm »

See if temporarily switching to an unmodified version of index.php fixes it. Make sure you didn't use an = instead of a .= somewhere when you made the modifications.
Logged

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Database error
« Reply #4 on: February 06, 2006, 08:27:46 pm »

I replaced my Index.php with a original one and there is no effect   :o
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Database error
« Reply #5 on: February 07, 2006, 05:02:17 pm »

in index.php find the function list_users

replace the var $sql with
Code: [Select]
       $sql = "SELECT owner_id as user_id, " .
               "owner_name as user_name, " .
               "COUNT(DISTINCT a.aid) as alb_count, " .
               "COUNT(DISTINCT pid) as pic_count, " .
               "MAX(pid) as thumb_pid " .
               "FROM {$CONFIG['TABLE_ALBUMS']} AS a  " .
               "INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON (p.aid = a.aid AND approved = 'YES') ";
        if ($FORBIDDEN_SET != "") $sql .= "WHERE $FORBIDDEN_SET ";
        $sql .= "AND category >= " . FIRST_USER_CAT . " GROUP BY user_id " .
                "ORDER BY thumb_pid DESC"; // order by last uploaded
                //"ORDER BY user_name"; // order by user name

and please tell me if it works

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Database error
« Reply #6 on: February 08, 2006, 10:07:00 am »

NO effect :(

I attached a copy of my current index.php , with tihs correction above
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Database error
« Reply #7 on: February 08, 2006, 10:09:56 am »

upgrade at least to cpg1.3.5
Logged

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Database error
« Reply #8 on: February 12, 2006, 03:55:46 pm »

It is 1.35 from months :)
Logged

Nibbler

  • Guest
Re: Database error
« Reply #9 on: February 12, 2006, 04:14:33 pm »

index.php says 1.3.3

uncomment this line

Code: [Select]
//                $sql = "SELECT owner_id as user_id, " .
Logged

pacimir

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Database error
« Reply #10 on: February 12, 2006, 07:54:11 pm »

Worked!

You are the best support for free script!
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.