I have a slight OOP problem.
Code: Select all
<?php
include("adodb/adodb.inc.php");
class BaseClass {
protected $db;
protected $testclass;
function __construct() {
$this->db = ADONewConnection("mysqli");
$this->db->Connect("localhost","root","","test");
$this->testclass = new ChildClass();
}
function getTestTable() {
return $this->testclass->getTable();
}
}
class ChildClass extends BaseClass {
function __construct() {
}
function getTable() {
return $this->db->GetAll("SELECT * FROM test");
}
}
$test = new BaseClass();
$data = $test->getTestTable();
?>Fatal error: Call to a member function GetAll() on a non-object...
What to do? Thank you in advance