Yan*_*ick 2 php mysql mysqli pdo
我实际上是在寻找mysql_real_escape_string的替代方案来解决这个错误.在PHP 5.4它完美但不再在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;
}
}
Run Code Online (Sandbox Code Playgroud)
Joh*_*nde 13
你使用MySQLi所以使用mysqli_real_escape_string()
:
$this->Email = $this->mysqli->real_escape_string($p_vValue);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
42218 次 |
最近记录: |