Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] SQL error in usergroups management in ACP [C-Michael83]
#3
Hello Ryan,

thanks for your answer!

I now edited the original file

/admin/modules/user/groups.php

on lines 1174 and 1182 and changed the code from

WHERE g.gid != '' GROUP BY g.gid

to

WHERE g.gid != '0' GROUP BY g.gid


Well, it just perfect now, thank you for the quick support! Smile
Since it does not directly belong to the issue before, I open a second reply post:

Klicking on the user management in the ACP, I got another error:

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
22P02 - ERROR: invalid input value for integer: »«
Query:
SELECT * FROM mybb_adminviews WHERE type='user' AND (vid='' OR uid=0) ORDER BY uid DESC

Corresponding URL: /admin/index.php?module=user

This query appears on 3 different lines in the users.php in the admin/modules folder, namely lines 1321, 1586 and 1709:

$default_view = fetch_default_view("user");
$query = $db->simple_select("adminviews", "*", "type='user' AND (vid='{$default_view}' OR uid=0)", array("order_by" => "uid", "order_dir" => "desc"));
$admin_view = $db->fetch_array($query);

For some reason (actually I'm not that much into SQL or PHP in general), $default_view seems to remain empty or give anything which corrupts the query itself, resulting in the error above.
Although I don't think of it as a good solution, I worked around this by changing the query into this:

$query = $db->simple_select("adminviews", "*", "type='user' AND uid=0", array("order_by" => "uid", "order_dir" => "desc"));

Could you somehow comment on this, might it be a PostgreSQL syntax issue?


Apart from that, I am also experiencing another SQL error when trying to optimize the database:

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
42601 - ERROR: syntax error at »OPTIMIZE« LINE 1: OPTIMIZE TABLE mybb_adminlog ^
Query:
OPTIMIZE TABLE mybb_adminlog

Corresponding URL: /admin/index.php?module=tools/optimizedb
Actually, the error is the same, regardless which table I choose - only the table's name changes according to my choice.

And this when trying to create a new user account:

Quote:SQL Error:
42P01 - ERROR: Relation »mybb_userfields_ufid_seq« does not exist
Query:
SELECT currval('mybb_userfields_ufid_seq') AS last_value

URL: /admin/index.php?module=user/users&action=add

Unfortunately, I have no idea how to solve this... I'm rather getting the impression that something isn't right with the files, since other forums have absolutely no problems at all... Undecided


Messages In This Thread
RE: SQL error in usergroups management in ACP - by vxl - 2008-09-24, 11:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)