• Resolved Ashley

    (@nosegraze)


    When installed on multisite, there’s a database error from this file:

    libs/sfmBasicActions.class.php

    WordPress database error Table ‘database.wp_339_users’ doesn’t exist for query select p.post_author,u.user_login from wp_339_posts p LEFT JOIN wp_339_users u on p.post_author=u.ID where p.post_status=”publish” and p.post_type=”post”

    Caused by this query:

    $wp_authors=$wpdb->get_results('select p.post_author,u.user_login from '.$wpdb->prefix.'posts p LEFT JOIN '.$wpdb->prefix.'users u on p.post_author=u.ID where p.post_status="publish" and p.post_type="post"',ARRAY_A);

    Here is the fix:

    $wp_authors=$wpdb->get_results('select p.post_author,u.user_login from '.$wpdb->posts.' p LEFT JOIN '.$wpdb->users.' u on p.post_author=u.ID where p.post_status="publish" and p.post_type="post"',ARRAY_A);

    I switched to using $wpdb->posts and $wpdb->users, which handles correct table names in multisite.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Database error in multisite’ is closed to new replies.