Code integration is as follows: {code...}, the following error occurs: Fatalerror: CannotaccessemptypropertyinF: Apache2.2htdocsemectest. phponline9. The abstract problem of removing the base class remains. Environment: apache2.2php5.3.5 code integration is as follows:
$db = MySQL::getIns(); }}class catModel extends Model{ protected $table = 'emec_cat'; public function addCat($date){ $sql = $this->db->Autoexpr($date); return $this->db->qurey($sql); }} class MySQL { static protected $Ins; protected $res; static function getIns(){ if(self::$Ins instanceof self){ return self::$Ins; } self::$Ins = new MySQL(); return self::$Ins; } private function __construct(){ $this->res = 1; } protected function __destruct(){ mysql_close($link); }}$date = array();$date['cat_name'] = $_POST['cat_name'];$date['parent_id'] = $_POST['parent_id'] + 0;$date['intro'] = $_POST['intro'];$catMode = new catModel();$catMode->addCat($date); ?>
:
Fatal error: Cannot access empty property in F:\Apache2.2\htdocs\emec\test.php on line 9
Remove the base classabstractThe problem persists.
Environment:
apache2.2 php5.3.5
Reply content:
Code integration is as follows:
$db = MySQL::getIns(); }}class catModel extends Model{ protected $table = 'emec_cat'; public function addCat($date){ $sql = $this->db->Autoexpr($date); return $this->db->qurey($sql); }} class MySQL { static protected $Ins; protected $res; static function getIns(){ if(self::$Ins instanceof self){ return self::$Ins; } self::$Ins = new MySQL(); return self::$Ins; } private function __construct(){ $this->res = 1; } protected function __destruct(){ mysql_close($link); }}$date = array();$date['cat_name'] = $_POST['cat_name'];$date['parent_id'] = $_POST['parent_id'] + 0;$date['intro'] = $_POST['intro'];$catMode = new catModel();$catMode->addCat($date); ?>
:
Fatal error: Cannot access empty property in F:\Apache2.2\htdocs\emec\test.php on line 9
Remove the base classabstractThe problem persists.
Environment:
apache2.2 php5.3.5
Write one more $