Query multiple tables at once?

SELECT * FROM wp_posts, wp_2_posts, wp_3_posts WHERE wp_posts.post_content LIKE ‘%foo’ OR wp_2_posts.post_content LIKE ‘%foo’ OR wp_3_posts.post_content LIKE ‘%foo’; should do the trick. (Note that in Multisite, there shouldn’t be a wp_1_posts — your root site uses wp_posts etc.)

I’m not able to get access to $wpdb [duplicate]

If you’re not using WP’s built in Ajax handlers, which includes things for you, you will need to include the WP core yourself. Try adding define(‘WP_USE_THEMES’, false); global $wpdb; require(BASE_PATH . ‘wp-load.php’); to the top of your file. I should point out that the path to wp-load.php may not be the same and hard coding … Read more

after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()

prepare() takes at least 2 parameters. Most of your calls to prepare() are not needed. For example: $blogids = $wpdb->get_col($wpdb->prepare(“SELECT blog_id FROM $wpdb->blogs”)); In this code, if the call to $wpdb->prepare() were valid, it wouldn’t do anything. The function doesn’t do anything to the first parameter. It manipulates the values in the other parameters passed … Read more

Plugins in WP_Options but not Active

Yes you will need to activate the plugins on the plugins page. A side note: For future reference if you need to disable plugins during a migration. Don’t migrate the plugins across and wordpress will automatically disable them. Then you would copy them to the plugins folder and active as usual. This would also keep … Read more