当我运行此代码时:
<?php
require_once 'getdata.class.php';
class Header extends GetData
{
public $headers;
public function sayfaHeader($sayfa = 1)
{
return parent::$sql = "SELECT * FROM header WHERE id='" . $sayfa . "'";
//$data = parent::getData();
return $data;
$this->headers = (object) $data;
return (object) $this->headers;
}
}
$header = new Header;
echo $header->sayfaHeader();
?>
我得到这个错误代码:
Fatal error: Access to undeclared static property: GetData::$sql in C:\AppServ\www\ilk\class\header.class.php on line 9
为什么我不能使用 parent:: 字?我只想更改public $sql的变量值