已弃用:mysql_connect()mysqli now

已弃用:mysql_connect()mysqli now,mysql,Mysql,嗨,请在这方面给我支持: 已弃用:mysql\u connect():mysql扩展已弃用,并且 将在将来被删除:在 什么是新版本?请参阅和。你应该可以做一些像 $this->conn = mysqli_connect ( $this->host, $this->user, $this->pass ) or die ( 'ERR_DB_CONNECT' ); $result = mysqli_query ( $query, $this->conn ) or die

嗨,请在这方面给我支持:

已弃用:mysql\u connect():mysql扩展已弃用,并且 将在将来被删除:在

什么是新版本?

请参阅和。你应该可以做一些像

$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 () );

请务必阅读文档以了解正确的返回VAL、异常和错误。

尝试在msqli_connect之前添加“@” 试试这个


$this->conn=@mysqli\u connect($this->host,$this->user,$this->pass)或die('ERR\u DB\u connect')

对于新版本的PHP,不推荐使用
mysql.*
函数。它抛出了这样一个错误。因此,请使用
mysqli.*
PDO
函数更改PHP5.5至5.3,tnks@FelipeUrrego我没有引用任何PHP版本。你的评论指的是什么?是否真的有必要用已经在这里的信息来necro一个五年的帖子/
$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 () );