Forum Moderators: coopster
I've been reading up on the correct way to go about escaping data entered into a database from the $_POST variable, but am in need of a bit of clarification.
I have the following piece of code which takes a user submitted name and enters it into a database:
$user = mysql_real_escape_string($_POST["user"]);mysql_query("INSERT INTO accounts (date, name, stats)
VALUES ('Jan 1', '$user', '546065')")
or die(mysql_error());
Joe's Name
Joe\'s Name
Or am I already doing it the correct way and it's just normal to have a database filled with the escaped slash marks?
Note: Magic quotes are Off.
Advice would be greatly appreciated, thanks! :)