I'll keep this short and simple, I am trying to apply some code to my insert query to prevent SQL injections. See the code below:
$insertquery = mysql_query("INSERT INTO users (firstname, lastname, email, username, password) VALUES ('".mysql_real_escape_string($fname)."', '".mysql_real_escape_string($lname)."', '".mysql_real_escape_string($email)."', '".mysql_real_escape_string($username)."', .'".mysql_real_escape_string($pass)."')");
header("location:index-login-page.php?msg1=Thank you for choosing SIAA, please login.");
The above code does not insert any data but it still prints the msg1 message. What am I doing wrong or is it even possible to prevent SQL injections on an insert statement.
Thank You
Sohail.