Topic: Getting userlist.php error

Hi, I can't figure out how to get rid of this certain SQL syntax error when going to userlist.php.

File: /home/gamesour/public_html/boards/userlist.php
Line: 157

PunBB reported: Unable to fetch user list

Database reported: 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 'BY username ASC LIMIT 0, 50' at line 1 (Errno: 1064)

Now, I've found Line 157, but I can't make out any syntax error, although I'm a newbie when it comes to SQL syntax. Line 157 is:

$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title, g.g_color FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').'ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

Because the error mentions the "near 'BY username ASC LIMIT 0, 50'" I'm guessing the error is near the only BY I see, along with the 50, so that's why that area is below as well. All help is appreciated. Thanks in advance.


'ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50')

2

Re: Getting userlist.php error

I'm useless with SQL, but it looks like you have the coloured usergroups mod installed, so double check the installation...

Re: Getting userlist.php error

Hmm, I just deleted then retyped the code and it worked o_O
Thanks for mentioning that though. I had gone back and copy+pasted the edited color usergroup code, which never worked. Who knows, but thank you.