WordPress.org

Ready to get started?Download WordPress

Forums

You have an error in your SQL syntax; check the manual... (7 posts)

  1. Pajje1
    Member
    Posted 4 years ago #

    All of a sudden my website displays the error message below when loged in users views posts. The error message doestn´t show when loged out.
    ---
    WordPress databasfel för 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 'p WHERE p.post_date < '2009-10-16 13:45:03' AND p.post_type = 'post' AND p. (wp' at line 1 förfrågan SELECT p.* FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) AS p WHERE p.post_date < '2009-10-16 13:45:03' AND p.post_type = 'post' AND p. (wp_posts.post_status = 'publish' OR (wp_posts.post_status = 'private' AND (pl_wp_postmeta.meta_key = 'post_level' AND pl_wp_postmeta.meta_value <= 2 ))) ORDER BY p.post_date DESC LIMIT 1 skapat av require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, adjacent_posts_rel_link, get_adjacent_post_rel_link, get_adjacent_post WordPress databasfel för 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 'p WHERE p.post_date > '2009-10-16 13:45:03' AND p.post_type = 'post' AND p. (wp' at line 1 förfrågan SELECT p.* FROM (wp_posts LEFT JOIN wp_postmeta as pl_wp_postmeta ON (wp_posts.ID = pl_wp_postmeta.post_id)) AS p WHERE p.post_date > '2009-10-16 13:45:03' AND p.post_type = 'post' AND p. (wp_posts.post_status = 'publish' OR (wp_posts.post_status = 'private' AND (pl_wp_postmeta.meta_key = 'post_level' AND pl_wp_postmeta.meta_value <= 2 ))) ORDER BY p.post_date ASC LIMIT 1 skapat av require, require_once, include, get_header, locate_template, load_template, require_once, wp_head, do_action, call_user_func_array, adjacent_posts_rel_link, get_adjacent_post_rel_link, get_adjacent_post
    ---
    Anybody with knowledge hwo can help me out with this?

  2. Can you get to the dashboard and admin? Can you do an upgrade or a reupgrade? Maybe it's just a damaged file that will get replaced on a upgrade/reupgrade.

  3. Pajje1
    Member
    Posted 4 years ago #

    Yes, i can get to dashboard and admin. I have v 2.8.4. Mabye i try reupgrade. I hope there is a way to fix this without an reupgrade?

  4. A reupgrade is easy, and the best thing to try to to begin with.

  5. Pajje1
    Member
    Posted 4 years ago #

    Okay, so a reupgrade is; delete the MySQL table and owerrite the existing wp insatall with a new one?

  6. No, an upgrade doesn't involve deleting the database or any mysql tables: http://codex.wordpress.org/Upgrading_WordPress_Extended

    You might have to start a new databse later, but try the upgrade first.

  7. Thomas
    Member
    Posted 4 years ago #

    Hm, I have got the some error for quite a long time now, from what I can see it has something to do with the navigation for the next and previeous post todo as this navigation has been broken since theese errors started to occur.

    What's wrong with this SQL?

    SELECT p.* FROM (wp_t_posts LEFT JOIN wp_t_postmeta as pl_wp_t_postmeta ON (wp_t_posts.ID = pl_wp_t_postmeta.post_id)) AS p WHERE p.post_date > '2009-12-21 17:26:14' AND p.post_type = 'post' AND p. (wp_t_posts.post_status = 'publish' OR (wp_t_posts.post_status = 'private')) ORDER BY p.post_date ASC LIMIT 1

    Btw: This problem started somewhere in 2.8.x and is still there with 2.9.

Topic Closed

This topic has been closed to new replies.

About this Topic