Using a singleton database class in functions and multiple scripts(PHP) - best use methods
- by dscher
I have a singleton db connection which I get with:
$dbConnect = myDatabase::getInstance();
which is easy enough. My question is what is the least rhetorical and legitimate way of using this connection in functions and classes? It seems silly to have to declare the variable global, pass it into every single function, and/or recreate this…