• I created a plugin that uses a different database than the default wp database. So I say:

    $newwpdb = new wpdb(connection settings here)

    It all work fine but then I have plugins that call mysql_query() without a connection setting and this seams to use the $newwpdb I set above in a different plugin rather than global $wpdb.

    Is that as expected? Any suggestion as to how I can prevent that?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • I know you can save and restore $wp_query with:

    $tempquery = clone $wp_query;
    -- do stuff with my query --
    $wp_query = clone $tempquery;

    It might be possible to do the same with $wpdb.

    Thanks vtxyzzy.

    This precisely helped. Powerful tip 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wpdb issue’ is closed to new replies.