WordPress database ...
 
Notifications
Clear all

[Solved] WordPress database error You have an error in your SQL syntax;

4 Posts
2 Users
2 Reactions
1,303 Views
copilot
Posts: 26
Topic starter
(@copilot)
Eminent Member
Joined: 6 years ago

Hi wpForo team,

When "Show Forum Statistic" (under: /wp-admin/admin.php?page=wpforo-settings&wpf_tab=components)
is enabled, I get the following PHP error:

WordPress database 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 ')
                            ORDER BY `userid` DESC LIMIT 1' at line 3 for query SELECT `userid` FROM `wp_wpforo_profiles`
                        WHERE `status` IN ('active')
                          AND `groupid` IN  ()
                            ORDER BY `userid` DESC LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Divi/page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, wpforo\wpforo->{closure}, include('/plugins/wpforo/themes/2022/index.php'), include('/plugins/wpforo/themes/2022/footer.php'), wpforo\wpforo->statistic, wpforo\classes\Members->get_newest_member, QM_DB->query
 
Web Server nginx/1.21.4
PHP Version 8.0.19
MySQL Version 5.6.51
 
Is this a known issue?
 
 
Cheers!
3 Replies
copilot
Posts: 26
Topic starter
(@copilot)
Eminent Member
Joined: 6 years ago

EDIT: The error also shows when the Forum Footer and Forum Statistics are disabled.

Can you make sense of this error? The thing that I do find odd is the missing value ():

 AND `groupid` IN  ()
Chris
Posts: 3627
(@chris)
Famed Member
Joined: 3 years ago

Hi @copilot,

The reason, is that you have disabled "Display on Members List" option from the Usergroup options for all the Usergroups, and because of that you get that SQL Syntax Error.

We will fix this for the new update,

Thanks.

1 Reply
copilot
(@copilot)
Joined: 6 years ago

Eminent Member
Posts: 26

Hi @chris,

Perfect! We have indeed hidden the member's list and delisted everyone.

Thank you for your quick fix.