Re: Global Connection object
| From: | szii at sziisoft dot com | Date: | Thu, 02 May 2002 17:15:29 +0000 |
| Subject: | Re: Global Connection object | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18951@lists.php.net to get a copy of this message | ||
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