2015-06-21 79 views
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向你提出任何建议。

+0

“Live”中没有定义属性或方法 – PiranhaGeorge

+0

没有Live类中没有方法和没有属性 – Victorino

+0

请发布完整db – PiranhaGeorge

回答

0

我发现了这个问题。这是因为没有数据库实例,正因为如此,它是以Live为例。

相关问题