This question already has an answer here:
Call to a member function on a non-object
BaseDatabase::IDatabase should be defined as protected, not private, for it to be available from your Mysql extension.
Or you could use
$this->set_database_behavior(new MysqlQuery()); instead of
$this->IDatabase = new MysqlQuery(); in your