NYCPHP Meetup

NYPHP.org

[nycphp-talk] OO & database connections

putamare jeffknight at mac.com
Thu Jul 15 14:50:02 EDT 2004


Here's a best practices question: my script has several objects, say 
one to do authorization and one or more others to display content, or 
whatever. Most, if not all, of these objects access multiple databases, 
one for authorization, one for content, etc.

Is it better to have object create its own private connection object 
(in my case I'm goofing off with the new mysqli_ functions, but I'm 
sure this would apply equally to PEAR::DB, or even an old school 
connection string), or creating a single connection object and passing 
that around to the other objects as needed?


Jeff Knight
putamare not junk at putamare.net




More information about the talk mailing list