class DB extends MySQLi{ function getRecordSet($sql){ ... //Return record set } }
class Department{ var $db; function getDepartment(){ return $this->db->getRecordSet('...'); } }
$dept=new Department(); $db=new DB(); $dept->db=$db; //Problem $department=$dept->getDepartment(); $department2=$dept->getDepartment();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)