• Resolved internationils

    (@internationils)


    [09-Apr-2017 06:16:10 UTC] 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 ‘searchterms <> “” AND searchterms <> “_” AND referer NOT LIKE “%mysite.net%” AN’ at line 3 for query
    SELECT REPLACE( SUBSTRING_INDEX( SUBSTRING_INDEX( SUBSTRING_INDEX( referer, “://”, -1 ), “/”, 1 ), “.”, -5 ), “www.”, “” ) AS referer_calculated, COUNT(*) counthits
    FROM wpTABLE_slim_stats
    WHERE searchterms IS NOT NULL searchterms <> “” AND searchterms <> “_” AND referer NOT LIKE “%mysite.net%” AND dt BETWEEN 1491004800 AND 1491722168
    GROUP BY referer_calculated
    ORDER BY counthits DESC
    LIMIT 0, 1000 made by wp_dashboard, do_meta_boxes, call_user_func, wp_slimstat_reports::callback_wrapper, call_user_func, wp_slimstat_reports::raw_results_to_html, call_user_func, wp_slimstat_db::get_top, wp_slimstat_db::get_results
    [12-Apr-2017 05:41:32 UTC] 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 ‘searchterms <> “” AND searchterms <> “_” AND referer NOT LIKE “%myothersite’ at line 3 for query
    SELECT REPLACE( SUBSTRING_INDEX( SUBSTRING_INDEX( SUBSTRING_INDEX( referer, “://”, -1 ), “/”, 1 ), “.”, -5 ), “www.”, “” ) AS referer_calculated, COUNT(*) counthits
    FROM TABLE2_slim_stats
    WHERE searchterms IS NOT NULL searchterms <> “” AND searchterms <> “_” AND referer NOT LIKE “%myothersite.com%” AND dt BETWEEN 1491004800 AND 1491979290
    GROUP BY referer_calculated
    ORDER BY counthits DESC
    LIMIT 0, 1000 made by wp_dashboard, do_meta_boxes, call_user_func, wp_slimstat_reports::callback_wrapper, call_user_func, wp_slimstat_reports::raw_results_to_html, call_user_func, wp_slimstat_db::get_top, wp_slimstat_db::get_results

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter internationils

    (@internationils)

    I received this error in my PHP logs on two separate sites, both running the latest WP and Slimstat.

    I just confirmed that’s bug in the code. I see same errors.

    [10-Apr-2017 14:20:57 UTC] 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 'searchterms <> "" AND searchterms <> "_" AND referer NOT LIKE "%xxxxx.com%" AN' at line 3 for query 
                            SELECT REPLACE( SUBSTRING_INDEX( SUBSTRING_INDEX( SUBSTRING_INDEX( referer, "://", -1 ), "/", 1 ), ".", -5 ), "www.", "" ) AS referer_calculated, COUNT(*) counthits
                            FROM wp_slim_stats
                            WHERE searchterms IS NOT NULL searchterms <> "" AND searchterms <> "_" AND referer NOT LIKE "%xxxxx.com%" AND dt BETWEEN 1491004800 AND 1491834054
                            GROUP BY referer_calculated 
                            ORDER BY counthits DESC
                            LIMIT 0, 1000 made by wp_dashboard, do_meta_boxes, call_user_func, wp_slimstat_reports::callback_wrapper, call_user_func, wp_slimstat_reports::raw_results_to_html, call_user_func, wp_slimstat_db::get_top, wp_slimstat_db::get_results
    

    File: admin/view/wp-slimstat-reports.php Line: 554

    'where' => 'searchterms IS NOT NULL searchterms <> ""

    it should be

    'where' => 'searchterms IS NOT NULL AND searchterms <> ""

    Plugin Author Jason Crouse

    (@coolmann)

    Thread Starter internationils

    (@internationils)

    Hi Jason, thanks… I didn’t see any mention of PHP errors in that bug so I had no idea it was the same issue.

    Plugin Author Jason Crouse

    (@coolmann)

    If you read the error, it says it’s an SQL error, not a PHP error. However, this is now solved in version 4.6.5. Please upgrade.

    Best,
    Jason

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP MYSQL errors’ is closed to new replies.