Het probleem is dat u uw verbinding tot stand hebt gebracht met MySQLi
, maar roepen dan mysql_real_escape_string()
. aan . Je bent van plan om mysqli_real_escape_string()
te bellen
ofwel in procedurele context, ofwel in objectgeoriënteerde context.
class Mysql
{
private $conn;
function __construct()
{
$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or
die('No Connection to database!');
}
function add_non_member($data)
{
$email = $data->email;
// Procedural call
$san_email = mysqli_real_escape_string($this->conn, $email);
// Or OO call (recommended)
$san_email = $this->conn->real_escape_string($email);
// etc...
}
// etc...;
}