“superglobal object”

leetzor

New Member
Using the following as an example (with $db being a previously created database connection object)...\[code\]Class Session { function write_log () { global $db; $db->query(...); }}\[/code\]Is there a way to avoid having to write "global $db" everytime I want to use the $db object inside of another class? In other words, declare the $db object as a superglobal from the very beginning.
 
Back
Top