Re: Global Connection object
| From: | Vinod Palan | Date: | Thu, 16 May 2002 01:19:20 +0000 |
| Subject: | Re: Global Connection object | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19206@lists.php.net to get a copy of this message | ||
Hi,
I Think most of people put connection object in separate file and include
the file when ever need.
And in that connection file I open the connection and its available thought
the file.
Thanks
Vinod
--
Vinod Palan A
Calypso Technology, Inc.
Vinod_palan@calypso-tech.com
(415) 817-2463 Phone
<szii@sziisoft.com> wrote in message
news:038e01c1f1fc$f5f87d00$fd02a8c0@surfmetro.com...
> Probably. However, you'll have to global($connection_obj) in each
function
> to allow access to that. I think newer versions of PHP have an auto
registering
> global namespace, however, and you may not need that global() call
anymore.
>
> Why would you want to? I believe the PHP/Zend engine has pooling
capabilities,
> so it's not really any overhead to "reconnect." If no pooling is
available, then you
> limit yourself (and your webserver) to a single connection. (Will kill
your performance.)
>
> HTH.
>
> 'Luck
>
> -Szii
>
> ----- Original Message -----
> From: "Shaun Johnston" <shaun@compverse.com.au>
> To: <php-db@lists.php.net>
> Sent: Wednesday, May 01, 2002 5:03 PM
> Subject: [PHP-DB] Global Connection object
>
>
> > Is it possible to make a MySQL connection object global, so that it
doesn't
> > need to be declared as a parameter to be accessed from individual
functions?
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>