Title: Error database &#8211; Latest post doesn&#039;t show
Last modified: August 21, 2016

---

# Error database – Latest post doesn't show

 *  Resolved [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/)
 * Hello,
 * Does it work in WordPress 3.6?
 * I get the following error, (feed shows last post, but widget doesn´t)
 *     ```
       WordPress database error Table 'database.wp42_posts' doesn't exist for query
       SELECT posts.ID, posts.post_date_gmt AS date
       FROM wp42_posts AS posts
       WHERE posts.post_type= 'post'
       AND posts.post_status= 'publish'
       AND posts.post_password= ''
       AND posts.post_date_gmt = '2013-09-13 11:09:20'
       ORDER BY posts.post_date_gmt DESC
       LIMIT 0,20
       made by require('wp-blog-header.php'),require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'),
       do_action('init'), call_user_func_array, Inpsyde\\MultisiteFeed\\{closure}, Inpsyde\\MultisiteFeed\\display_feed, referer: http://www.domain.com/wp-admin/network/settings.php?page=inpsyde                  -multisite-feed-page
       http://wordpress.org/plugins/wp-multisite-feed/
       ```
   

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/page/2/?output_format=md)

 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124707)
 * You have not this table `wp42_posts`. wp42 is your prefix from the wp-config.
   php. Can you check this?
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124736)
 * Hello Frank,
 * Thanks for your reply.
 * Sorry, I’m reviewing logs, and the most errors came from ‘database.wp_posts’ (
   not wp42), it is wordpress multisite, therefore this table doesn’t exist.
 * The error is generated when the url feed multisite is executed.
 * The plugin is network enabled.
 * Thanks.
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124741)
 * Ok, thanks.
    But the plugin use the codex to create the string of the database.
   Do you have tables with prefix `wp42`?
 * Multisite, which version?
    Maybe you havent before a blog in the network with
   ID 42, maybe killed later?
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124754)
 * WP version 3.6.1
    Yes, the site with id 42 exists.
 * But wp_posts doesn’t exist, so is correct.
 * In fact, the plugin is working, is showing the last posts. But this log error
   continues appearing.
 * Thanks,
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124819)
 * Hello,
 * I’m back with the same issue 🙂
 * I’m checking your plugin code and try to understand why is appearing a database
   error in the log.
 * >  $results = $wpdb->get_results( “
   >  SELECT posts.`ID`, posts.`post_date_gmt`
   > AS date FROM `" . $wpdb->base_prefix . ($blog_id > 1 ? $blog_id . '_' : '')."
   > posts` AS posts $only_podcasts_sql_from WHERE posts.`post_type` = ‘post’ $only_podcasts_sql_where
   > AND posts.`post_status` = ‘publish’ AND posts.`post_password` = ” AND posts.`
   > post_date_gmt` < ‘” . gmdate( “Y-m-d H:i:s” ) . “‘ $only_podcasts_sql ORDER
   > BY posts.post_date_gmt DESC LIMIT 0,” . (int) $max_entries_per_site );
 * This line (at plugin.php), $wpdb->base_prefix . ($blog_id > 1 ? $blog_id . ‘_’:”),
   throw the error, because for the main blog (id = 1) id is ommited . But id 1 
   does exist, and wp_posts doesn’t exist for multisite, it must be prefixtable_1_posts
 * Now, moreover, when I publish a post in network: it is showed at feed page, but
   not at widget.
 * If I try to disable cache, also the last post published doens’t appear.
 * Can you help me, please?
 * It is a good plugin, but doesn’t work well yet.
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124820)
 * Hi xzoom,
    on each installs, there I have checked is the `_1_` not exist, always
   without ID-Number for the main and then start on the value 2. Do you have `_posts`
   and then also `_posts` tables with the ID, start with 1?
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124821)
 * Hi Frank,
 * > $wpdb->base_prefix . ($blog_id > 1 ? $blog_id . ‘_’ : ”)
 * in my case, the main blog is: baseprefixtable_1_posts
 * So, as blog_id = 1, the result is: baseprefixtable_ posts (which doesn’t exist),
   and then it is threw the following database error:
 * WordPress database error Table ‘database.baseprefixtable_posts’ doesn’t exist
   for query
 * Thank you,
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124822)
 * Yes, I have understand, that you not have the _posts without a number and with
   the 1, but for me is this a little bid stupid, all installs, there I have checked
   have no tables with key 1. But I think I will change the source, that we check
   for the table key.
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124823)
 * Okay, I didn’t know that other multisite installations there is no id = 1 (my
   wp multisite is older than 4 years)
 * In fact, there are some constants, where you can define the default.
 * define (‘SITE_ID_CURRENT_SITE’, 1);
    define (‘BLOGID_CURRENT_SITE’, ‘1 ‘);
 * From what I’ve seen, the majority is 1.
 * I don’t quite understand, but the fact is that you can not omit the id 1, whether
   or not the main blog.
 * Don’t you think?
 * Thanks a lot,
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124824)
 * Yes, I see it now also. It is not a good idea to remove the 1 from the select.
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124835)
 * Hello Frank,
 * When will you update your plugin in order to solve this bug?
 * thanks!!!!
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124836)
 * Yes, I will – only a time problem.
    But I have it on the todos, maybe next weekend.
   Sorry.
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124837)
 * Hello xzoom,
    please can you test this new version, download here: [https://github.com/inpsyde/WP-Multisite-Feed/archive/master.zip](https://github.com/inpsyde/WP-Multisite-Feed/archive/master.zip)
 * I have change the select for the prefix, but I can’t test with a version, there
   have a ID 1 in a Multisite environment.
    Thanks!
 *  Plugin Author [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * (@bueltge)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124838)
 * The new version is online, hope this helps.
 *  Thread Starter [xzoom](https://wordpress.org/support/users/xzoom/)
 * (@xzoom)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/#post-4124839)
 * Hello Frank,
 * I have tested it and now it works correctly. The log error dissapeared.
 * Thanks a lot for your work!

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/page/2/?output_format=md)

The topic ‘Error database – Latest post doesn't show’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-multisite-feed.svg)
 * [Inpsyde Multisite Feed](https://wordpress.org/plugins/wp-multisite-feed/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-multisite-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-multisite-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-multisite-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-multisite-feed/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Frank Bueltge](https://wordpress.org/support/users/bueltge/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/error-database-latest-post-doesnt-show/page/2/#post-4124840)
 * Status: resolved