Advanced search  

News:

cpg1.5.44 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.42 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: SQL Fehler bei Auswählen des Menüpunkts Benuterliste  (Read 7620 times)

0 Members and 1 Guest are viewing this topic.

Matthias002

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • Gallery
SQL Fehler bei Auswählen des Menüpunkts Benuterliste
« on: December 15, 2010, 12:37:43 AM »

HUHU

ich habe leider das Problem das ich wenn ich meine Benutzerliste, unter den Menüpunkt Meine Gallery öffen möchte eine Fehlermeldung bekomme.
Die Meldung lautet im Debug-Modus:

Code: [Select]
While executing query 'SELECT user_id AS user_id, user_name AS user_name, user_email AS user_email, UNIX_TIMESTAMP(user_regdate) AS user_regdate, UNIX_TIMESTAMP(user_lastvisit) AS user_lastvisit, user_active AS user_active, COUNT(pid) AS pic_count, ROUND(SUM(total_filesize)/1024) AS disk_usage, group_name, group_quota FROM `db1014951-urlaub`.cpg15x_users AS u INNER JOIN db1014951-urlaub.cpg15x_usergroups AS g ON u.user_group = g.group_id LEFT JOIN db1014951-urlaub.cpg15x_pictures AS p ON p.owner_id = u.user_id GROUP BY user_id ORDER BY user_regdate DESC LIMIT 0, 25;' in bridge/udb_base.inc.php on line 230

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 '-urlaub.cpg15x_usergroups AS g ON u.user_group = g.group_id LEFT JOIN db1014951-' at line 1


Weiß den jemand eine Lösung für das Problem?

MFG

MAtthias
Logged

Αndré

  • Administrator
  • Coppermine addict
  • ****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: SQL Fehler bei Auswählen des Menüpunkts Benuterliste
« Reply #1 on: December 15, 2010, 10:07:25 AM »

Öffne bridge/udb_base.inc.php, finde
Code: [Select]
        $sql = "SELECT {$f['user_id']} AS user_id, {$f['username']} AS user_name, {$f['email']} AS user_email, {$f['regdate']} AS user_regdate, {$f['lastvisit']} AS user_lastvisit, {$f['active']} AS user_active, "
               . "COUNT(pid) AS pic_count, ROUND(SUM(total_filesize)/1024) AS disk_usage, group_name, group_quota "
               . "FROM {$this->usertable} AS u "
               . "INNER JOIN {$C['dbname']}.{$C['TABLE_USERGROUPS']} AS g ON u.{$f['usertbl_group_id']} = g.group_id "
               . "LEFT JOIN {$C['dbname']}.{$C['TABLE_PICTURES']} AS p ON p.owner_id = u.{$f['user_id']} "
               . $options['search']
               . "GROUP BY user_id " . "ORDER BY " . $sort_codes[$options['sort']] . " "
               . "LIMIT {$options['lower_limit']}, {$options['users_per_page']};";
und ersetze es durch
Code: [Select]
        $sql = "SELECT {$f['user_id']} AS user_id, {$f['username']} AS user_name, {$f['email']} AS user_email, {$f['regdate']} AS user_regdate, {$f['lastvisit']} AS user_lastvisit, {$f['active']} AS user_active, "
               . "COUNT(pid) AS pic_count, ROUND(SUM(total_filesize)/1024) AS disk_usage, group_name, group_quota "
               . "FROM {$this->usertable} AS u "
               . "INNER JOIN `{$C['dbname']}`.{$C['TABLE_USERGROUPS']} AS g ON u.{$f['usertbl_group_id']} = g.group_id "
               . "LEFT JOIN `{$C['dbname']}`.{$C['TABLE_PICTURES']} AS p ON p.owner_id = u.{$f['user_id']} "
               . $options['search']
               . "GROUP BY user_id " . "ORDER BY " . $sort_codes[$options['sort']] . " "
               . "LIMIT {$options['lower_limit']}, {$options['users_per_page']};";


Bitte bestätige ob es damit funktioniert, da ich diese Änderung dann so einpflegen kann.
Logged

Matthias002

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • Gallery
Re: SQL Fehler bei Auswählen des Menüpunkts Benuterliste
« Reply #2 on: December 15, 2010, 10:53:00 AM »

Wau, ich glaube du kannst zaubern :-), es funktioniert.
Vielen Dank

Magst du mir bitte sagen, wo der fehler lag, und warum die anderen Coppermine user, das Problem nicht haben?

MFG

Matthias
Logged

Αndré

  • Administrator
  • Coppermine addict
  • ****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: SQL Fehler bei Auswählen des Menüpunkts Benuterliste
« Reply #3 on: December 15, 2010, 11:23:16 AM »

Scheinbar hat bisher niemand einen Datenbanknamen mit Bindestrich benutzt. Deine Datenbank heißt "db1014951-urlaub". Anhand der Fehlermeldung
Quote
near '-urlaub.cpg15x_usergroups
war das das Naheliegendste ;)

Ich habe die Änderungen in SVN-Revision 8137 eingepflegt.
Logged
Pages: [1]   Go Up
 

Page created in 0.064 seconds with 21 queries.