• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1214
  • Last Modified:

.php insert text in mysql / strange characters


I would like to add text into mysql, but there is something fishy going on.
When i try to put this word into mysql: geïsoleerd

it changes into:  geïsoleerd

When submitted here, the values above change. The first word has an i with double dots.
The second has a capital A with an ~ on top and a High line.

Never had this problem before. Anyone knows what's going on?
  • 3
1 Solution
dwaxAuthor Commented:

Hmm aparently the same issue appear here...
try using htmlspecialchars() function to "encode" your text BEFORE you write it to the DB, or at least before you echo it to screen in a browser.
dwaxAuthor Commented:

Thanks for your reply.
I did try htmlspecialchars(),   but it doesn't change it.

Never had this problem. This forum also suffers from this thing.
Any other ideas?
dwaxAuthor Commented:

Okay, found the solution :
$Text = htmlentities(utf8_decode($_POST['Text']));

That does the trick!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now