Deprecated: mysql_real_escape_string(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO

45,914

You using MySQLi so use mysqli_real_escape_string():

$this->Email = $this->mysqli->real_escape_string($p_vValue); 
Share:
45,914
Yannick
Author by

Yannick

Updated on July 09, 2022

Comments

  • Yannick
    Yannick almost 2 years

    I'm actually looking for an alternative to mysql_real_escape_string to solve this error. in php 5.4 it worked perfectly but no longer in php 5.5

    $this->mysqli = new mysqli($this->host, $this->user, $this->pass, $this->name);
    // in class user
    public function __set($p_sProperty, $p_vValue)
            {   
                switch($p_sProperty)
                {    
    // this is marked as the error
    case "Email":
                 $this->Email = **mysql_real_escape_string**($p_vValue); 
                    break;
    }
    }