[wp-hackers] New wpdb instance

Dino Termini dino at duechiacchiere.it
Fri Oct 17 01:04:19 UTC 2014


Hi list,

I need to connect to a different database to retrieve some data. So I'm 
instantiating a new $wpdb object:

$new_wpdb = new wpdb( params );

It happens sometimes that I enter the wrong credentials, and if WP_DEBUG 
is true, this renders the WP admin totally inaccessible and I need to 
rename my plugin's folder to get it back:

https://core.trac.wordpress.org/browser/trunk/src/wp-includes/wp-db.php#L581

How can I check that the credentials I have are legit without blowing up 
the admin?

Thanks,
Dino.


More information about the wp-hackers mailing list