I'm trying to connect to another database in Wordpress in a separate PHP file. I am using wpbd()
but kept getting a fatal error that wpdb() could not be found. I found the following code online and the function does then seem to be found.
require_once( Path to '/wp-load.php' );
global $wpdb;
$mydb = new wpdb('username','password','dbname','localhost');
At this stage in the network tab in inspector tools I get the following error messages:
require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in (url) on line 2
require_once(wp-load.php): failed to open stream: no suitable wrapper could be found in (url) on line 2
require_once(): Failed opening required 'wp-load.php' (include_path='.;C:\php\pear') in (url) on line 2
The URL specified in all the errors above is the PHP file I am calling wpdb from.