Re: Scope of Variables and use of global and this->var
| From: | tedd | Date: | Wed, 15 Jul 2009 21:28:04 +0000 |
| Subject: | Re: Scope of Variables and use of global and this->var | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295442@lists.php.net to get a copy of this message | ||
At 12:21 PM +0200 7/14/09, Anton Heuschen wrote:
In my index.php page I then use $dbconnect again .... but do I simply use $dbconnect again ... or must I say global $dbconnect and then use it in the rest of the DB calls? or use GLOBALS ..Anton: My way -- every time I open a database, I do so by including the configuration.php file that holds the logon/password et other data to connect with the database. When I'm done with what I want from the database, I close it. I do not store anything in GLOBALS. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com