Bit of an unusual request. I have a series of individual wordpress websites. they are not a multisite, as I need each to have unique domain names for the various sections of network.
What I want to do, is be able to access a unique plugin table that resides on one of the sites, but not the other for data display purposes. The reason I do this is, all the payments for this subscription service go through one site, but not the other. Saves money instead of having to purchase 3 or more version of woocommerce subscriptions.
So far I have tried :
define('DB_SERVER', 'xxx.xxx.xxx.xxx');
define('DB_USERNAME', 'sister_site');
define('DB_PASSWORD', 'xxxxxx');
define('DB_DATABASE', 'database1_wrdp1');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
if (!$db)
{
DebugLog("Error: Unable to connect to MySQL." );
DebugLog("Debugging errno: " . mysqli_connect_errno());
DebugLog("Debugging error: " . mysqli_connect_error());
}
else
DebugLog('Connection SUCCESS!' );
I get the error: Error: Unable to connect to MySQL. Access denied for user xxxxx
I have assigned a unique user for the database with the information and inserted that into the othersites PHP code and am attempting to just connect. No luck.
Anyone have any ideas on how the one site can gain access to the wordpress database in the other site. All sites are on the same IP address, same server, just independent accounts.