• People, just got my site over from MT to WP.
    All was good until I started customising a few plugins etc and now I get this error message on th post pages (not index pages)

    Any takers. Thanks.
    The site: http://karmakars.com
    click any individual post and u will see the following error.

    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 post_date ASC LIMIT 0,1’ at line 1]
    SELECT ID,post_title FROM wp_posts WHERE post_date > ” AND post_date < ‘2005-07-04 14:02:07’ AND post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 0,1

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator James Huff

    (@macmanx)

    Do you see the error when all plugins are deactivated?

    Thread Starter amitk

    (@amitk)

    Guess what I figured it out … I had installed ‘time unavailable’ plug in…. and it screwed up the DB. Not good. Remove that plug in from Codex people. There should be zero tolerance for bad coding!

    The bit that seems to caused the problem.

    // DO NOT MODIFY BELOW THIS LINE
    if(!strstr($_SERVER[‘PHP_SELF’], ‘feed/’) && !strstr($_SERVER[‘PHP_SELF’], ‘wp-admin/’)) {
    echo $message.'<br/>Plugin provided by Taragana‘;
    exit();
    } else if(strstr($_SERVER[‘PHP_SELF’], ‘feed/’) || strstr($_SERVER[‘PHP_SELF’], ‘trackback/’)) {
    $retry_after = $retry_after * 60;
    header(“HTTP/1.0 503 Service Unavailable”);
    header(“Retry-After: $retry_after”);
    exit();
    }
    ?>

    Moderator James Huff

    (@macmanx)

    Thanks for the update. Angsuman (Taragana) is very good about supporting the quality of his plugins. Rather than pull the plugin from the Codex, I will forward this thread to him so that he can evaluate the situation. I assume that he will want to get in touch with you through this thread, so please check back.

    Thread Starter amitk

    (@amitk)

    Sure thing I have subscribed to the RSS! Thanks.

    Must say that when I installed the plug in and activated it it did work the way it should but after I deactivated it. It never even showed in my plugins panel. Soon I deleted the file through FTP all was good!

    The plugin doesn’t touch the database in any way. It doesn’t make any queries nor does it modify any data. The query you mention is not related to this plugin either.

    It is not possible for this plugin to contribute to database corruption in any way. There must be some other cause.

    The code you have quoted above simply sends a unavailable message to a client when the plugin is activated.
    The plugin has been very well tested.

    Database can be corrupted for many reasons but this simply cannot be it. Have you tried modifying the database in any way manually? That is the most likely cause.

    What have you seen in the code that lead you to believe it may have contributed or it is bad code? Please justify your answers before making wild insinuations.

    Did you modify the plugin in any way, however minor?

    BTW: If you want any plugin authors to respond to a plugin issue then the best place to contact him is through the appropriate plugin page.

    I had no idea of this post till MacManx kindly pointed me this way.

    Thanks MacManX.

    Thread Starter amitk

    (@amitk)

    Hi angsuman, I modified the message only with my own custome message. Other than that the code was not touched at all.

    Try without any modification just for testing. Re-download from my site.

    I can assure you whatever caused this it was definitely not this plugin, at least not in its original form(unmodified).

    Also can you post future comments on the plugin page? It makes it easier to track for me. Yes, you can subscribe to the rss feed of the page there to keep track.
    Let me know how it goes.

    Moderator James Huff

    (@macmanx)

    Also, try repairing your MySQL database. See: http://www.tamba2.org.uk/wordpress/repair/

    Thread Starter amitk

    (@amitk)

    angsuman, thanks! I am not sure i want to try that in a hurry but will soon when i have test blog to experiemnt with. Thanks again!

    A repair wasn’t necessary like I said before all I had to do was take off the plugin and all was back to normal. But thats macmanx πŸ™‚ for whatever the reason it was that one plugin that didn’t work well under the given circumstance. Must admit the repair link has good tutorials. Thanks again!

    That could happen if your plugin settings got corrupted in the database.

    Again to repeat it is logically impossible for this plugin (unmodified) to corrupt the database in any way or to throw that error that you saw. If I had a million dollars I would have bet it on it πŸ™‚

    Moderator James Huff

    (@macmanx)

    And, though a repair was not needed to solve the problem, it may be needed to prevent future occurrences.

    Thread Starter amitk

    (@amitk)

    Alright where is the $1 mill. I might try it then πŸ™‚

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

The topic ‘WordPress database error’ is closed to new replies.