嗨,请给我支持:
不推荐使用:mysql_connect():不推荐使用mysql扩展 将来将被删除:使用mysqli或PDO代替......
$this->conn = mysql_connect ( $this->host, $this->user, $this->pass ) or die ( 'ERR_DB_CONNECT' );
$result = mysql_query ( $query, $this->conn ) or die ( mysql_error () );
什么是新版本?
答案 0 :(得分:0)
请参阅http://us1.php.net/mysqli_connect和http://us1.php.net/manual/en/mysqli.query.php。你应该可以做一些像......
$this->conn = mysqli_connect ( $this->host, $this->user, $this->pass ) or die ( 'ERR_DB_CONNECT' );
$result = mysqli_query ( $query, $this->conn ) or die ( mysqli_error () );
请务必阅读文档以了解正确的返回值,例外情况和错误。
答案 1 :(得分:-2)
尝试在msqli_connect之前的两个语句中添加“ @” 试试这个
$ this-> conn = @mysqli_connect($ this-> host,$ this-> user,$ this-> pass)或死掉('ERR_DB_CONNECT');