• I’m getting a database error message when I click on a single-post page on my blog:

    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 dailyhey_posts WHERE post_date > ” AND post_date < ‘2005-08-04 19:47:23’ AND post_status = ‘publish’ AND ID != ORDER BY post_date ASC LIMIT 0,1

    This error first appeared when I upgraded from 1.2 to 1.5. Upgrading to 1.5.1.3 did not fix it. It appears despite the selected theme. I have another blog running off the same database where the error does not occur. I am stumped.

    The error in action:
    http://www.lucubus.com/?p=676

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s occuring in the <head> portion of your template.

    Do you have a plugin displaying next and previous <link> tags, or something like that? I ask because the only SQL in WP that matches your error output is found in the get_next_post() function, and the only reason for that to appear in the <head> is if it’s outputting a “next” relationship link tag.

    Thread Starter lucahack

    (@lucahack)

    Aha! You got it. I had the plugin Link Rel running. Deactivating it made the error go away. I can’t quite remember why I installed it in the first place, but that’s a different problem. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database errors on single post pages’ is closed to new replies.