php - PDO extend for a crud querys and Fatal error -
i'm trying make query class crud , want extend connection other class, error : fatal error: call member function prepare() on non-object !? miss ? or stupito extend ? here mysql_connection extend querys class. both different php files. class mysql_connection extends querys { protected $dbh = null; function __construct() { try { $this->dbh = new pdo('mysql:host=host; dbname=db','user','pass', array(pdo::mysql_attr_init_command=> 'set names utf8')); $this->dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); $this->dbh->setattribute(pdo::attr_default_fetch_mode, pdo::fetch_assoc); } catch(pdoexception $e) { $this->dbh = null; print('error on connection'.$e->getmessage()); die(); ...