I am trying to input <TEXT AREA>data into a mysql database field using PHP. Any text that appears after a colon ' does not get entered into the field. IE,
Hello it's a nice day
appears as Hello it
the rest of the data is lost.
I've tried using tried using addslashes()/stripslashes()
stripslashes() removes \ from the text but still looses the string.
addslashes() stores Hello it\\\\ the rest disapears.
This is basic, surely???
anyone help??
Thanks.
mysql data entry
Moderator: General Moderators
hmmm.... i seem to remember
i seem to remember running into this problem with a student of mine, and while we never figured out what was causing it, the solution was to do a stripslashes() and follow that with an addslashes() on the resulting string. i could be mistaken, but it doesn't hurt to try.
-c.w.collins
-c.w.collins
- ILoveJackDaniels
- Forum Commoner
- Posts: 43
- Joined: Mon May 20, 2002 8:18 am
- Location: Brighton, UK
Another quick fix for this is to use the following code on the data entered into the field before ANYTHING else:
Code: Select all
eregi_replace("'","'",$textarea_data);Thanks
Thanks for your replys, I've cracked it now,
$message=urlencode($message); allows all data to be passed, then
urldecode(); returns it to original format.
The ereg_replace() sound interesting, I will have alook at that,
Thanks again all.
$message=urlencode($message); allows all data to be passed, then
urldecode(); returns it to original format.
The ereg_replace() sound interesting, I will have alook at that,
Thanks again all.