Hi,
I'm trying to connect a remote database in WordPress.
I have some data on the remote server (1.1.1.1) which I want to access in WordPress installation.
Currently, the WordPress database is connected to serve(2.2.2.2)
what I found on the internet is to connect to another database from the same server or host.
How can i connect remote host ...?
Thanks in advance
I'm trying to connect a remote database in WordPress.
I have some data on the remote server (1.1.1.1) which I want to access in WordPress installation.
Currently, the WordPress database is connected to serve(2.2.2.2)
what I found on the internet is to connect to another database from the same server or host.
PHP:
function connect_another_db() {
global $seconddb;
$seconddb = new wpdb(USERNAME, PASSWORD, DATABASE_NAME, HOSTNAME);
}
add_action('init', 'connect_another_db');
Thanks in advance