1
我有這個奇怪的錯誤。 我有DB類和Live類。 Live類不擴展DB類。 我不明白爲什麼當我宣佈新生活發生。 的錯誤是:聲明新類時致命錯誤的方法
Notice: Undefined property: Live::$isOff in /home/main/Database/DB.class.php on line 570
Fatal error: Call to undefined method Live::Query() in /home/main/Database/DB.class.php on line 574
這就是我得到了這條線:
ON DB.Class.php
public function setCharset($charset) {
if (self::$isOff){
return false;
}
self::$charset = $charset;
self::Query("SET NAMES '".$charset."'");
return self;
}
ON Live.Class.php
class Live
{
protected $PaypalLogo = '';
protected $isQA = null;
protected $siteURL = null;
public function __construct() {
DB::setCharset("utf8");//Setting charset here and that is gives Fatal Error.
if (strstr($_SERVER['SERVER_NAME'], "ba.")) {
$this->isQA = true;
$this->siteURL = "http://ba.live.com";
}
else {
$this->isQA = false;
$this->siteURL = "http://www.live.com/";
}
}
Th向你提出任何建議。
「Live」中沒有定義屬性或方法 – PiranhaGeorge
沒有Live類中沒有方法和沒有屬性 – Victorino
請發佈完整db – PiranhaGeorge