This issue is so strange:
I have a database class file, then I create an instance of this class:
[CODE]$database = new database($host, $user, $pwd, $dbName)
Then I use it to make some query and it works
[CODE]
$database->setQuery(“SELECT * FROM my_example limit 0,1”);
$company = $database->loadObjectList();
Afte that, I want to pass this instance as one of my arguments into another class constructor:
[CODE]
require_once(“../classInfo.class.php”);
$objClass = new classInfo($courseID, $requestArr, $database);
Inside of my “classInfo”, I have constructor:
[CODE]
$this->database = $database;
But when I call a function inside of “classInfo”, it gives me “Call to a member function setQuery() on a non-object” error:
[CODE]
$objClass->callMyFunction();