WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] SQL Error regarding comments and syntax (5 posts)

  1. KirkM
    Member
    Posted 6 years ago #

    I've been getting the following error in my WP root error.log ever since my host upgraded their servers to the latest versions of PHP and MySQL. Does anyone have a clue as top what the cause of this is?

    [29-Jan-2008 04:55:36] 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 'AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5' at line 1 for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5

    The only comment plugins I use are Akismet and WP Ajax Edit Comments which never caused a problem before. Since then I've deactivated WP Ajax and switched from Aksimet to Defensio just for troubleshooting purposes--no change. This error hasn't seemed to have any affect on the site functions at all, it's just annoying that I can't find the cause.

    I also upgraded to 2.3.2 just prior to the server upgrade so it might be something to do with WP 2.3.2 as well, I'm not sure and I do not have the coding ability (yet) to track down something like this beyond basic troubleshooting. Looks like it might have to do with 2.3.2 commenting functions--still working on it and any help would be appreciated. Thanks!

    I'm WP 2.3.2 on PHP 5.2.5 and MySQL 5.0.45

  2. mccormicky
    Member
    Posted 6 years ago #

    People were saying they couldn't post comments so I said uh oh what is it now? I checked the error log and this was the same/similar error as the person above:
    'AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10' at line 1 for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10
    with wp 2.3.3 but mysql 4 12 and not sure what php level...
    I optimized the table because there was a message in phpadmin to do so.
    If the error is being triggered by people posting comments how do I fix that?
    After I checked the table there were 2 new error messages in the error log.So the problem isn't fixed even though now you can post comments...I'm worried that 2 new comments will start the problem all over again.
    There seems to be a size or memory issue because I deleted 2 spam comments and was able to post new comments either logged in as admin or logged out as guest.
    I have no idea what those kinds of messages mean or how to fix them and I am afraid of mysql!

  3. rrhobbs
    Member
    Posted 6 years ago #

    I am getting this same error in my log too for no apparent reason... anybody? thx

  4. jdybka
    Member
    Posted 6 years ago #

    I'm getting this error as well.

  5. KirkM
    Member
    Posted 5 years ago #

    Upgrading to WP 2.5 seems to have solved this problem or at least I haven't seen it for awhile now. I also eliminated all but one plugin that was not hosted on the WordPress.org plugin directory. The one plugin that is not hosted on the directory is the old Favicon Manager which has never caused a problem.

    Anybody on WP 2.5 that's still experiencing the problem?

Topic Closed

This topic has been closed to new replies.

About this Topic