For a number of reasons, I’ve split my site into two wp installs, www and blog. I’d like to be able to access recent posts from www and print them on blog, and I thought I could do this by having both wp installations share the same database. I tried to access www posts from within blog by using set_prefix, like so:
SELECT $wpdb->posts.* FROM $wpdb->posts
WHERE $wpdb->posts.post_type = ‘post’
ORDER BY $wpdb->posts.post_date DESC
$pageposts = $wpdb->get_results($querystr, OBJECT);
But $pageposts is empty.
Any idea what I’m doing wrong?
- The topic ‘Unable to access tables with different prefix’ is closed to new replies.