[wp-hackers] WP and Plugins DB connection conflicts

Jennifer Hodgdon yahgrp at poplarware.com
Tue Jun 26 13:55:10 GMT 2007

>> I believe the usual thing for a plugin is to use $wpdb to do database 
>> queries, rather than creating its own database connections. Is there 
>> some reason these plugins cannot be rewritten to do that? It might 
>> mean adding a require() line somewhere, to make sure $wpdb has been 
>> initialized, but then there would be no conflict.

> I think the issue arrises when a Plugin wants to access a seperate 
> database than Wordpress's.
> I saw a Trac ticket which refered to something similar earlier actually:
> http://trac.wordpress.org/ticket/2722
> the solution in the Ticket description isnt the best though.

In this case, the person who posted to the list said he was logging in 
with the same credentials as WP, though. Most plugins (I think) use 
the WP db, since some users on shared hosts will not have permission 
to create new DBs, and anyway people probably want all their 
WP-related data in the same database.  The Trac post was in regards to 
using a db on a completely different host.

      -- Jennifer

More information about the wp-hackers mailing list