Reputation: 5117
Can somebody know why mysqli doen't work in some servers?
$mysqli = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
echo '-'.mysqli_real_escape_string($mysqli,"ab'c").'-';
mysqli_close($mysqli);
It display "--" insted of "-ab\'c-"
Upvotes: 0
Views: 80
Reputation: 46900
There is only 1 possible explanation of this. Your connection failed to get established and $mysqli
is not a valid MySQLi Resource.
var_dump($mysqli);
That will confirm this.
Upvotes: 1