How come entering words with an apostrophe go into my table ok but when echoing them back out, it adds a slash to them? I have managed to fix the problem using stripslashes but I'm curious as to how the data went in fine in the first place. Something in php.ini?....
A problem I have relating to the above question is the following:
$get_prod_name= 'SELECT * FROM ' .$Table. ' WHERE prod_name="' .$_POST['prod_name'].'"';
When the posted variable is something like the word My brother's car, the query fails as what it submits is:
SELECT * FROM prod WHERE prod_name="My brother"
Running the following in SQL directly works:
SELECT * FROM prod WHERE prod_name="my brother's car"
So I figured that using ' instead of " to enclose the query would work but it appears not so any advice is appreciated!