0

When I make a search on my site no posts are retrieved and through wordpress debug I get this error message:

WordPress database error: [Table 'theme_se.wp_comments' doesn't exist]

SELECT SQL_CALC_FOUND_ROWS wp_theme_se_posts.ID FROM wp_theme_se_posts WHERE 1=1 AND ( (wp_posts.post_title LIKE '%paradox%') OR (wp_posts.post_content LIKE '%paradox%') OR EXISTS ( SELECT * FROM wp_comments WHERE comment_post_ID = wp_posts.ID AND comment_content LIKE '%paradox%' ) OR EXISTS ( SELECT * FROM wp_terms INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_id = wp_terms.term_id INNER JOIN wp_term_relationships ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id WHERE taxonomy = 'post_tag' AND object_id = wp_posts.ID AND wp_terms.name LIKE '%paradox%' ) ) AND wp_theme_se_posts.post_type IN ('post', 'page', 'attachment', 'referenser', 'partners', 'galleri') AND (wp_theme_se_posts.post_status = 'publish' OR wp_theme_se_posts.post_author = 1 AND wp_theme_se_posts.post_status = 'private') ORDER BY wp_theme_se_posts.post_title LIKE '%paradox%' DESC, wp_theme_se_posts.post_date DESC LIMIT 0, 12

I have deleted all my plugins but it is still not working and the wp_comments table does exist when I view it through phpmyadmin

  • What is your database table prefix - both in phpmyadmin and in your wp-config.php? Did you change it at any time after installing WordPress? – Tim Malone Jun 25 '16 at 22:24
  • Not sure but in phpmyadmin it is wp_theme_se_ so for example wp_theme_se_posts . In wp_config file the table prefix is wp_ . And no I have not changed the table prefixes anywhere after WordPress installation :/ – HannesH Jun 25 '16 at 22:33
  • Now it works great! I removed a search optimizing function and fixed the prefixes and now it works great! :)))))) – HannesH Jun 25 '16 at 22:43
1

As discussed in the comments, your database prefix settings are off-kilter.

Check the database prefix actually in use in your database, and make sure it's the same as the one in wp-config.php. Also make sure all of your WordPress-related tables have the same prefix.

You'll also need to search through your database, particularly in the _options table, as the previous database prefix will be hard coded in there in a few places.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.