Why do I get this error even when I am using mysqli_real_escape_string
? In this example, doesn't mysqli_real_escape_string escape quotes in the string?
Parse error: syntax error, unexpected 'X' (T_STRING) in C:\xampp\htdocs\PHP\processor.php on line 20
<?php
$text = "I'm "X-MAN"";
$con = @mysqli_connect( "localhost:3306", "root", "P@ssw0rd", "DogSport" ) or die ("Couldn't connect to server");
echo mysqli_real_escape_string($con, $text);
?>