Topic: Syntax error in admin/forums.php (line 595)

Hello,

Do you know why I can't edit forums: when I click on mywebsite/admin/forums.php?edit_forum=2, there is an error "Sorry! The page could not be loaded."

pun debug shows:

Syntax error near 'WHERE g.g_id!=1 ORDER BY g.g_id' line 1 (Errno: 1064).

SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM forum_groups AS g LEFT JOIN forum_forum_perms AS fp ON g.g_id=fp.group_id AND fp.forum_id= WHERE g.g_id!=1 ORDER BY g.g_id

Error line 595 in /home/mywebsite/admin/forums.php

Apparently, the forum's ID is missing in "AND fp.forum_id=".

I don't understand why it doesn't work. I use PunBB 1.4.4 with PHP Version 5.6.30.

My file is exactly the same as this one: https://github.com/punbb/punbb/blob/mas … forums.php

Thank you.

Re: Syntax error in admin/forums.php (line 595)

add line

var_dump($forum_id);

in https://github.com/punbb/punbb/blob/mas … s.php#L593
What prints?

Parserus - BBCode parser
I speak only Russian  :P

Re: Syntax error in admin/forums.php (line 595)

Nothing else :

Syntax error near 'WHERE g.g_id!=1 ORDER BY g.g_id' line 1 (Errno: 1064).

SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM forum_groups AS g LEFT JOIN forum_forum_perms AS fp ON g.g_id=fp.group_id AND fp.forum_id= WHERE g.g_id!=1 ORDER BY g.g_id

Error line 595 dans /website/admin/forums.php

Re: Syntax error in admin/forums.php (line 595)

It is fantastic smile
Look for the extensions that change the $forum_id variable.

Parserus - BBCode parser
I speak only Russian  :P

5 (edited by progent 2017-06-13 12:05)

Re: Syntax error in admin/forums.php (line 595)

Thank you, Visman. I probably made a modification somewhere.
I found it, sorry for the inconvenience. ;-)