Wordpress : is it possible to connect $wpdb class into other database?
-
23-09-2019 - |
Question
the question is related to wordpress coding only. If it possible, the code solution is able to use inside a wordpress blog.
$wpdb is only work with database that been declare in wp-config. So it possible to clone $wpdb then use the clone to access different database?
Solution
You can just create a new instance:
$db2 = new wpdb('root','root','test','localhost');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow