Reputation: 83
I have a form that has a text area in it. The user types a comment and it gets inserted into my database. My problem arises when the comment has an apostrophe in it...When I go to retrieve the comment and display it on the screen the apostrophe doesn't show up, and seems to be transformed into some weird character. Do I need to choose a certain mysql data type (varchar, text, blob) to avoid this?
Upvotes: 0
Views: 128
Reputation: 501
The easiest way to fix your problem is that you can encode your data before your store them into database, after encoding, there will be no special character, and when you retrieve it, you can decode, such as urlencode ,urldecode.
Hope helps!
Upvotes: 2