Re: [PHP-DB] Global Connection object
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. [EMAIL PROTECTED] (415) 817-2463 Phone <[EMAIL PROTECTED]> wrote in message 038e01c1f1fc$f5f87d00$[EMAIL PROTECTED]">news:038e01c1f1fc$f5f87d00$[EMAIL PROTECTED]... > 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" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > 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 > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Global Connection object
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Global Connection object
Just put it in a separate file and include it in whatever page needs to access the DB. -Lisi At 10:03 AM 5/2/02 +1000, Shaun Johnston wrote: >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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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