-1

Hi please give me support in this:

deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in...

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

what is new version?

Maak
  • 4,720
  • 3
  • 28
  • 39
Felipe Urrego
  • 29
  • 1
  • 1
  • 5

2 Answers2

-1

See http://us1.php.net/mysqli_connect and http://us1.php.net/manual/en/mysqli.query.php. You should be able to do something like...

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

Be sure to read the docs for proper return vals, exceptions, and errors.

chaseisabelle
  • 162
  • 2
  • 18
-3

Try adding '@' before msqli_connect to both statements Try this

$this->conn = @mysqli_connect ( $this->host, $this->user, $this->pass ) or die ( 'ERR_DB_CONNECT' );

Stevooh
  • 15
  • 5
  • 2
    Was it really necessary to necro a five year old thread with information which was already in here? :/ – maio290 Jun 16 '19 at 11:48