WordPress.org

Ready to get started?Download WordPress

Forums

Database error? (4 posts)

  1. wallflower03
    Member
    Posted 9 years ago #

    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'' at line 1]
    SELECT COUNT(comment_ID) FROM wp_comments WHERE comment_post_ID = AND comment_approved = '1';

    It says this on the index page of my blog where the content (of blog entry) is supposed to appear. I was wondering which part went wrong. I'd really appreciate it if anyone could help me out with this.
    Also, I would like to know where can I find the default templates.
    Thank you.

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    If the blog you mean is the one linked from your name, then everything now looks sweet.
    Default templates ? Not sure what you mean ?

  3. Anonymous
    Unregistered
    Posted 9 years ago #

    What causes this kind of error message anyway? I get the following message as an admin when I try to view a post with a future timestamp. Note that after the SQL errors, it finally gives the correct plain-language error message.
    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 '' at line 3]
    SELECT category_id, cat_name, category_nicename, category_description, category_parent FROM wp_categories, wp_post2cat WHERE wp_post2cat.category_id = cat_ID AND wp_post2cat.post_id =
    Warning: Invalid argument supplied for foreach() in /home/homecome/public_html/weblog/wp-includes/template-functions-category.php on line 65
    Sorry, no posts matched your criteria.
    Like a 404 message, I also get it when I type in a bad URL:
    http://homecomers.org/weblog/index.php/archives/2004/9 instead of http://homecomers.org/weblog/index.php/archives/2004/10 (my blog started in October so there are no September entries).

  4. mdmcginn
    Member
    Posted 9 years ago #

    Well, I guess something I did today fixed the problem. Now when I try to access a non-existent page, or one that is dated for the future, I get the simple "Sorry, no posts matched your criteria."

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.