[wp-hackers] New wpdb instance

Konrad Karpieszuk kkarpieszuk at gmail.com
Wed Oct 22 20:37:22 UTC 2014


I think real problem you have with wpdb->bail() which has wp_die() inside.

Anyway, whenever where problem is exactly, you can always extend wpdb class
to your my_wpdb() class (name it better) and overwrite some methods. Then
call new my_wpdb( params ) and all will be good


--
(en) regards / (pl) pozdrawiam
Konrad Karpieszuk
http://tradematik.pl wtyczka do WordPressa do tworzenia sklepów dla
klientów z Polski


On Fri, Oct 17, 2014 at 3:04 AM, Dino Termini <dino at duechiacchiere.it>
wrote:

> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list