How to access an object from another class?

frantz

New Member
I have a DB class, which is used to make select, update, delete mysql queries.Now, I want to create a mysql query inside another class, but if I define $db = new DB(); in index.php, I can't use the $db var in another class. Do I have to define the variable $db over and over again, if I want to make a query? Or is there a way to make the $db var with an object global var?Thanks, Mike.
 
Back
Top