Title: PHP error MariaDB server version
Last modified: October 13, 2025

---

# PHP error MariaDB server version

 *  Resolved [raphaelw](https://wordpress.org/support/users/raphaelw/)
 * (@raphaelw)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/)
 * Hi,
 * i recently got to know this php error:
 * Got error ‘PHP message: WordPress database error You have an error in your SQL
   syntax; check the manual that corresponds to your MariaDB server version for 
   the right syntax to use near 
   ‘} AND postid = 2581’ at line 1 for query SELECT
   SUM(pageviews) AS pageviews FROM `wp_popularpostssummary` WHERE {$views_time_range}
   AND postid = 2581; made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request,
   do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters,
   rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server-
   >respond_to_request, WordPressPopularPosts\Rest\ViewLoggerEndpoint->update_views_count,
   do_action(‘wpp_post_update_views’), WP_Hook->do_action, WP_Hook->apply_filters,
   custom_wpp_update_postviews, wpp_get_views’
 * i may have an outdated dabase version, i’m not sure.
   Could you help?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-error-mariadb-server-version%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/#post-18678774)
 * Hi [@raphaelw](https://wordpress.org/support/users/raphaelw/),
 * I was able to reproduce the problem thanks to your detailed report, I appreciate
   it! I’ll release a fix for this soon.
 * For the time being, please find this code in your theme’s functions.php file:
 *     ```wp-block-code
       function custom_wpp_update_postviews($postid) {    $accuracy = 30;    if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) {        update_post_meta(            $postid,            'views_weekly',            wpp_get_views($postid, 'weekly', false)        );    }}add_action('wpp_post_update_views', 'custom_wpp_update_postviews');
       ```
   
 * And comment it out, like so:
 *     ```wp-block-code
       function custom_wpp_update_postviews($postid) {    $accuracy = 30;    if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) {        update_post_meta(            $postid,            'views_weekly',            wpp_get_views($postid, 'weekly', false)        );    }}// add_action('wpp_post_update_views', 'custom_wpp_update_postviews');
       ```
   
 * Once version 7.3.5 is out you can revert that change.
 *  Thread Starter [raphaelw](https://wordpress.org/support/users/raphaelw/)
 * (@raphaelw)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/#post-18678957)
 * Thank you so much!
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/#post-18679495)
 * Hey [@raphaelw](https://wordpress.org/support/users/raphaelw/),
 * Version 7.3.5 is out. It should fix the issue that you reported so please update
   as soon as you can, then undo the changes from my previous comment and you should
   be good to go.
 * If you have any other comments / questions please let me know.
 *  Thread Starter [raphaelw](https://wordpress.org/support/users/raphaelw/)
 * (@raphaelw)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/#post-18680176)
 * Thanks a million Hector!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP error MariaDB server version’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [raphaelw](https://wordpress.org/support/users/raphaelw/)
 * Last activity: [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-error-mariadb-server-version/#post-18680176)
 * Status: resolved