[wp-hackers] Help with wpdb Class Errors

Mike Walsh mpwalsh8 at gmail.com
Thu May 14 00:39:04 GMT 2009

After reading the replies to my question I did some digging around and
indeed I was exceeding the number of connections allowed in my
development area (100).  I didn't think my code was creating this many
connections but obviously it was.

I had originally started using another instance of wpdb because I
didn't want to potentially interfere with somthing WordPress was
doing.  This was a concern I had when I first started working with
WordPress and hadn't ever changed because it worked.  It wasn't until
it stopped working and I read the replies here that I realized that
what I was doing was unnecessary.

It was fairly trivial to change my plugin code to use the existing
wpdb connection instance and after playing with it for a day or so, I
am ready to declare success.

Thanks for the tips, reusing the existing connection hadn't even
occured to me until it was suggested here.


On Mon, May 11, 2009 at 9:29 AM, Chris Williams <chris at clwill.com> wrote:
> You could be running into the connection limit on the server, and/or a
> per-session connection limit.  As scribu notes, there is no reason to
> want/need another instance.
>> From: Mike Walsh <mike_walsh at mindspring.com>
>> Subject: [wp-hackers] Help with wpdb Class Errors
>> In the plugin I am working on I am using WP's wpdb database class to access
>> custom tables.  From time to time, I run into a problem where creating a new
>> instance of a wpdb class fails and I am at a loss as to why.
> <snip>
>> Anyone have any suggestions on how to track this down?
> _______________________________________________
> 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