apostrophe problem
Posted: Mon Jan 23, 2006 4:31 pm
I've seen fixes when using mysql through a command line but I'm not sure how to tweak my php code to work.
I've got a form, when filled out with and apostrophe like don't, will not pass into my db. I don't want to have to add backslashes each time I enter an apostrophe, so how can I fix this?
Here's the sql statement.
How can I fix this?
I've got a form, when filled out with and apostrophe like don't, will not pass into my db. I don't want to have to add backslashes each time I enter an apostrophe, so how can I fix this?
Here's the sql statement.
Code: Select all
$sql ="INSERT INTO `testTable` values ('', '$_POST[headline]','$_POST[content]')";
if (mysql_query($sql,$conn)){
echo "records added!";
}else{
echo "something went wrong";
}