I’m having a problem when using mysql_real_escape_string to allow apostrophes to be inputted into fields in a mySQL db.
Basically it cuts off the value of the data after the first instance of an apostrophe. So “Testing testing’s test testtesting” would be truncated to “Testing testing” and so forth.
Hi Cups, well I checked the actual value in the db in phpMyAdmin and saw that mysql_real_escape_string was actually doing it’s job and the data was going in correctly. However when it was being displayed back out using the “Edit details” form, it was cutting off at the first apostrophe- so I used htmlentities thus:
htmlentities($description, ENT_QUOTES);
Where $description was the variable for the Description field containing text with apostrophes.
Hopefully this will help anyone who has a similar issue at any point.
Isn’t that what Fou-Lou advised you to do a couple of days ago on the other forum? - That being the case, why did you then come here and ask for more help?
My apologies, having just checked over there I see you started them both on the same day/time. I thought I’d seen that topic two days ago - clearly I was wrong!