My 2nd DB queries are showing no results, why?
-
So I have a 2nd db and i’m trying to query from it but i’m getting no results or errors, why is this?
This is what I use to show results:
global $newdb; $newdb = $newdb->get_results("SELECT * FROM test");
And this is my connection in functions.php:
add_action('init','my_new_db'); function my_new_db(){ global $newdb; $newdb = new wpdb('test', 'test', 'test', 'localhost'); $newdb->show_errors(); }
I guess the fact that I get no errors means I have a connection?
Anyway please help!
- The topic ‘My 2nd DB queries are showing no results, why?’ is closed to new replies.