致命错误:未捕获错误:调用未定义函数mysqli_ping()

时间:2016-08-16 22:16:53

标签: php wamp

错误

  

致命错误:未捕获错误:调用未定义函数mysqli_ping()   在C:\ wamp \ www_server \ server.php:2938堆栈跟踪:#0   C:\ wamp \ www_server \ server.php(2926):database-> connected()#1   C:\瓦帕\ www_server \ server.php(37):   database-> _construct('localhost','root','password123','ixatdb'#2   C:\ wamp \ www_server \ server.php(10):iXatServer-> _constru ct()#3   (主要)在第2938行的C:\ wamp \ www_server \ server.php中抛出

下面第2938行

return @mysqli_ping($this->‌​link) ? true : false;

以下代码示例

public function __construct($host=null, $user=null, $pass=null, $name=null)
{
    if($name != null)
    {
        $this->host = $host;
        $this->user = $user;
        $this->pass = $pass;
        $this->name = $name;
    }

    if(!$this->connected())
    {
        $this->link = @mysqli_connect($this->host, $this->user, $this->pass, $this->name);
        if(!$this->connected())
        {
            $this->error("Failed to connect to `{$this->host}`.`{$this->name}` using password [" . (empty($this->pass) ? "NO" : 'YES') . "]");
        }
    } return true; // Cause I can put it there if I want to
}

public function connected()
{
    return @mysqli_ping($this->link) ? true : false;
}

0 个答案:

没有答案