• artyom2010

    (@artyom2010)


    Hello, can you check the error below and point me WHICH FILE or parth of the site is causing this error.

    [Fri Mar 04 23:37:59.682275 2016] [:error] [pid 9392] [client 222.127.94.8:45468] 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 '' at line 10 for query SELECT DISTINCT ID, post_title, post_password, comment_ID,\n comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved,\n comment_type,comment_author_url,\n SUBSTRING(comment_content,1,110) AS com_excerpt\n FROM wp_comments\n LEFT OUTER JOIN wp_posts ON (wp_comments.comment_post_ID =\n wp_posts.ID)\n WHERE comment_approved = '1' AND comment_type = '' AND\n post_password = ''\n ORDER BY comment_date_gmt DESC LIMIT made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/theme/404.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, Comments->widget, referer:

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

    (@rudym)

    Can you change to comment_type is null instead of comment_type = '' ? Perhaps same with post_password = ''.

    Thread Starter artyom2010

    (@artyom2010)

    I found out the error is on my theme when i change to the default wp theme that error doesnt appear.

    Your suggestion sir, how do i apply that?

    Thread Starter artyom2010

    (@artyom2010)

    hi i found this on my theme i believe this is it. Can you please point me out what to change on the code below.

    $sql = “SELECT DISTINCT ID, post_title, post_password, comment_ID,
    comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved,
    comment_type,comment_author_url,
    SUBSTRING(comment_content,1,100) AS com_excerpt
    FROM $wpdb->comments
    LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
    $wpdb->posts.ID)
    WHERE comment_approved = ‘1’ AND comment_type = ” AND
    post_password = ”
    ORDER BY comment_date_gmt DESC LIMIT “.$comment_posts;

    $comments = $wpdb->get_results($sql);
    $output = $pre_HTML;

    foreach ($comments as $comment) {

    Moderator cubecolour

    (@numeeja)

    which theme is causing this issue?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can someone read this error for me?’ is closed to new replies.