致命错误:未捕获错误:尝试连接时调用未定义函数mysql_connect()

时间:2018-12-06 00:55:45

标签: php mysql xampp

我是PHP编程的新手,在链接连接时遇到了此问题。我在第20行出现此错误

这是第20行中的代码:$ this-> conn = mysql_connect(server,user,pass);

public function open_connection() {
    $this->conn = mysql_connect(server,user,pass);
    if(!$this->conn){
        echo "Problem in database connection! Contact administrator!";
        exit();
    }else{
        $db_select = mysql_select_db(database_name,$this->conn);
        if (!$db_select) {
            echo "Problem in selecting database! Contact administrator!";
            exit();
        }
    }

}

0 个答案:

没有答案