Possible Duplicate:
Best way to prevent SQL Injection in PHP
Is this code protected enough against sql injection
if(isset($_POST['Submit']))
{
$user = mysql_real_escape_string($_POST["user"]);
$pass = mysql_real_escape_string($_POST["pass"]);
$confirm_key=md5(uniqid(rand()));
$query = mysql_query("INSERT INTO members
(user, pass, mail, confirm_key, country, city, www, credo)
VALUES ('$user','$pass','$_POST[mail]','$confirm_key','$_POST[country]','$_POST[city]','$_POST[www]','$_POST[credo]')")
or die ("Error during INSERT INTO members: " . mysql_error());
exit();
}
Is this the right way and must be each input (like country, city...) be protected ?