I’d like to start with a little background, in case anyone has any better ideas for design.
I’m looking to create a database class that connects to a database at construction. I would use functions to call the database, to get what I want. The database connection would be closed at destruction.
Since I’m connecting in construction, I’d like to use some properties as part of the mysql_connect… but they’re not initialized until construction. I was wondering if there is a way to initialize member variables like a member-wise initialization list in C++, but in PHP.
create a configuration array and pass that to the database class
If your other classes need the info they can use the array as well. Basically the registry pattern.