• Resolved xzoom

    (@xzoom)


    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)
  • Plugin Author Frank Bueltge

    (@bueltge)

    You have not this table wp42_posts. wp42 is your prefix from the wp-config.php. Can you check this?

    Thread Starter xzoom

    (@xzoom)

    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

    (@bueltge)

    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

    (@xzoom)

    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

    (@xzoom)

    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

    (@bueltge)

    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

    (@xzoom)

    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

    (@bueltge)

    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

    (@xzoom)

    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

    (@bueltge)

    Yes, I see it now also. It is not a good idea to remove the 1 from the select.

    Thread Starter xzoom

    (@xzoom)

    Hello Frank,

    When will you update your plugin in order to solve this bug?

    thanks!!!!

    Plugin Author Frank Bueltge

    (@bueltge)

    Yes, I will – only a time problem.
    But I have it on the todos, maybe next weekend. Sorry.

    Plugin Author Frank Bueltge

    (@bueltge)

    Hello xzoom,
    please can you test this new version, download here: 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

    (@bueltge)

    The new version is online, hope this helps.

    Thread Starter xzoom

    (@xzoom)

    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)
  • The topic ‘Error database – Latest post doesn't show’ is closed to new replies.