I have two databases on my server, and wanted to know is there a way to access both databases from wordpress? My thought is adding the second set of credentials to the wp-config.php
.
1 comment
Comments are closed.
I have two databases on my server, and wanted to know is there a way to access both databases from wordpress? My thought is adding the second set of credentials to the wp-config.php
.
Comments are closed.
You can easily set up another
$wpdb
object to access your other database.That, of course, uses the default connection credentials but if you defined different constants and used those, is should work just fine.
If this other database is not a WordPress database, you won’t have some of the functionality offered by the
wpdb
class but the basics should work if you write the SQL.