• After moving the files and database to another host it seems that the imported database isn’t working as it should. I’m getting the 404 Page not found error, and the 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 ‘FROM wp_posts WHERE 1=1 ORDER BY wp_posts.post_date DESC’ at line 1]
    SELECT FROM wp_posts WHERE 1=1 ORDER BY wp_posts.post_date DESC

    What am I missing? I followed all the necessary steps, and the URL remains the same, so it should be pretty straightforward.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’re not selecting anything:

    SELECT FROM wp_posts WHERE 1=1 ORDER BY wp_posts.post_date DESC;

    should be something like:

    SELECT * FROM wp_posts WHERE 1=1 ORDER BY wp_posts.post_date DESC;

    or

    SELECT post_title, post_author FROM wp_posts WHERE 1=1 ORDER BY wp_posts.post_date DESC;

    And WHERE 1=1 seems superfluous, but it may be something in the context I’m not seeing with one snippet of SQL.

    Thread Starter Bluealek

    (@bluealek)

    But I haven’t made any changes in the database, I just imported it on the new host. And the URL remains the same. So what is causing this behaviour and what exactly should I do to repair it?

    The admin panel is normally accessible, only it doesn’t see ANY posts or pages (although they’re all present in the database).

    Are there any other error messages? (with a filename and line number) If not (and if it isn’t set already), set DEBUG to true in your wp-config.php. Need to know where the SQL is being generated.

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

The topic ‘Fault in database after hosting change’ is closed to new replies.