WordPress.org

Ready to get started?Download WordPress

Forums

Latest edits
[resolved] appears to be broken (2 posts)

  1. madivad
    Member
    Posted 4 years ago #

    I was looking forward to this one, but when i go to inspect the widget I have this error:

    SELECT DISTINCT p.ID, p.post_title, p.post_author, u.display_name, p.post_modified, p.post_type FROM wp_1_posts p INNER JOIN wp_1_users u ON u.ID = p.post_author WHERE (p.post_type = 'post' OR p.post_type = 'page') ORDER BY p.post_modified DESC LIMIT 0, 10

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/abc/public_html/xyz/wp-content/plugins/latest-edits/latest-edits.php on line 38

    BTW, I echo'd out the SQL just to see if something jumped out at me... it didn't!

    http://wordpress.org/extend/plugins/latest-edits/

  2. madivad
    Member
    Posted 4 years ago #

    and then there it is. Today I have done a lot of work on the database and learned much about it's structure. The mistake lies in the user table declaration/definition as it occurs for MU. The code below will work for WordPress (single install) and WordPressMU.

    Where the plugin declares the tables after this comment:

    // Define DB table names
    	$table_name = $wpdb->prefix . "posts";
    	$user_table_name = $wpdb->prefix . "users";

    Change to

    // Define DB table names for both MU and single DB
    	$table_name = $wpdb->posts;
    	$user_table_name = $wpdb->users;

    All is then good. Tried, tested, and it works

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic