ohh, I see. So the database instance is a reference to the class and then pass the reference into the subclass. Then in the subclass assign it to a variable. I'll try that...
Yes, it works, thank you, thank you, thank you.
For anyone that is following this, here is what I did:
Here is the instance of the classes
$db = &new Database('mysql',$dbserver,$dbusername,$dbpassword,$dbdatabase);
$html = new htmlclass(&$db);
and here is the begining of the subclass:
class htmlclass{
var $dbConn = null;
function htmlclass($dbConn)
{
$this->dbConn = $dbConn;
}
this is the method that is in the subclass which is calling the database class:
function nav_teasers($query){
while($row = $this->dbConn ->FetchAssoc($query)){
Echo "<i><div class='row1'>";
Print $row["City"];
print "</div></i>";
//$this -> teasers($row["CityID"]);
Print "<p>";
}
}