Re: Opinion about the using $GLOBALS directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 and it will return the same
connection and thus transactions will work fine.

You did notice the "static" keyword in there right?

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux