If a valid database connection is mysql_real_escape_string() , mysql_real_escape_string() assumed to be safe for string data under any circumstances (with the rare exception described in this answer ).
However, nothing from the line fails:
$id = mysql_real_escape_string($_GET["id"]); mysql_query("SELECT * FROM table WHERE id = $id");
still vulnerable because you donβt have to break out of line to add an extra command.
source share