Database error Database error
 

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

Database error

Started by pacimir, February 06, 2006, 02:47:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pacimir

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 :)

Nibbler

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

pacimir

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

Nibbler

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.

pacimir

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

Stramm

in index.php find the function list_users

replace the var $sql with
       $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

NO effect :(

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

Joachim Müller

upgrade at least to cpg1.3.5

pacimir


Nibbler

index.php says 1.3.3

uncomment this line

//                $sql = "SELECT owner_id as user_id, " .

pacimir

Worked!

You are the best support for free script!