2015-07-11, 10:12 PM
(2015-07-11, 02:54 PM)Ad Bakker Wrote: [ -> ]Replace line 292 of viewgroups.php:
by:$query = $db->simple_select("users", "*",$search_sql, array('limit' => "{$start}, {$per_page}"));
$query = $db->query("SELECT u.*, f.* FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid = u.uid) WHERE {$search_sql} LIMIT {$start}, {$perpage} ");
I believe I did'n make a syntax error, when I do (curly brackets are tricky sometimes) .m. will see .
I received this error:
SQL Error:
1064 - 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 '' at line 5
Query:
SELECT u.*, f.* FROM mybb_users u LEFT JOIN mybb_userfields f ON (f.ufid = u.uid) WHERE (usergroup='4' OR CONCAT(',',additionalgroups,',') LIKE '%,4,%') LIMIT 0,
(2015-07-11, 08:15 PM)dragonexpert Wrote: [ -> ]You need to redefine $search_sql to use u.usergroup not usergroup because of using aliasing on the mybb_users table. You'll also need to look at $additional_sql and change it to u.additionalgroups. Finally, in $total_rows you need to change
to($db->simple_select("users", "COUNT(uid) as users", $search_sql), "users");
($db->simple_select("users u", "COUNT(u.uid) as users", $search_sql), "users");
I received this error:
SQL Error:
1054 - Unknown column 'u.usergroup' in 'where clause'
Query:
SELECT * FROM mybb_users WHERE (u.usergroup='4' OR CONCAT(',',u.additionalgroups,',') LIKE '%,4,%') LIMIT 0, 15
I was only supposed to change 'usergroup' to 'u.usergroup' on line 284 and 'additonalgroups' to 'u.additionalgroups' on lines 279 and 282 right?