I am wondering if I will break something if I do the following inside my theme’s index.php?
$wpdb = new wpdb(‘myuser’, ‘mypass’, ‘otherdb’, ‘myserver’);
assign back to original
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
I want to do this to get some info from another wordpress that I run on the same server.
Thank you for an answer.
- The topic ‘Can I reassign global $wpdb object in a theme?’ is closed to new replies.