mysql real escape function is escaping ’ " these things from query my variable but i need these thing in my query that i can insert the same name which is in my variable
if my variable is
$variable = Hello I don’t like
it enter in database same Hello I don’t like
not like idont like
You don’t have to stripslashes on the way out. The escape is not stored in the db as a character. Be sure you escape each variable individually before composing your SQL string. Will also prevent SQL injection. (good habit)
Do not store strings such as Hello I don\'t like into the database. Adding and removing slashes can be a PITA; sooner or later you would end up displaying Hello I don\\\\\'t like on your website. Do this instead:
No. They were right, my brain had a fart. Addslashes was the old way of escaping strings.
Real Escape String should just plop the data into the database as it is when it came in. Retrieving it should be just a straightforward query and output.