Re: Opinion about the using $GLOBALS directly
| From: | Richard Lynch | Date: | Wed, 19 Dec 2007 16:07:33 +0000 |
| Subject: | Re: Opinion about the using $GLOBALS directly | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266094@lists.php.net to get a copy of this message | ||
On Wed, December 19, 2007 8:14 am, js wrote:
> That wouldn't work well when you have to update multiple tables in a
> transaction.
> I think it's more maintainable to use GLOBALS than passing around dbh
> to classes/functions.
I also just use a 'global' for my db connection, for small to medium
web applications.
It's used all over the place, it's only one variable, and it's just
not that tricky to remember that it's a global named $connection
Others I'm sure consider this "bad" but there it is.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?