[PHP] Re: Opinion about the using $GLOBALS directly

2007-12-19 Thread Colin Guthrie
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. But you don't need to pass the dbh around to classes or functions, they can just call getDB when they need it

[PHP] Re: Opinion about the using $GLOBALS directly

2007-12-19 Thread Colin Guthrie
Sancar Saran wrote: And this is why I'm asking here, WHY I should avoid globals like plague ? Every one says bad. Alright, but no one says WHY ? Well for one thing it makes things harder to trace. You look at some code and you're just using some magic global variable. You can't tell what kind