For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2006 > Re: [PEAR] why is PEAR::DB constantly initting connection?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] why is PEAR::DB constantly initting connection?
joseph

2006-03-24, 7:04 pm

2006-03-24 (±Ý), 07:52 -0800, Justin Patrin ¾²½Ã±æ:
> On 3/23/06, joseph <kmh496@kornet.net> wrote:
> You're not really using DB how you should be. You'r eusing far too
> many globals and normal functions. Just use DB directly, don't use
> functions like this.
>
> Also try looking into PEAR::setErrorHandling().
>


i upgraded to MDB2 and there is no more DB init stuff going on.
also, i added
PEAR::setErrorHandling(PEAR_ERROR_DIE);
to my global variable initialization file
and am getting rid of the nasty code wrappers for PEAR::DB / MDB2.
thanks for pointing out MDB2 i had no idea it was the new DB.
(the documentation on PEAR.php.net is like not really there saying that
out in the open).


> Likely this "Init DB" thing is due to DB selecting the DB before every
> query. If this is why it's happening don't bother to complain about
> it, it's needed to correctly allow for multiple database connections.
>
> You could also try using MDB2 and see if that does the same thing.
> MDB2 is the supported DB layer now, DB is deprecated.
>
> --
> Justin Patrin
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com