Solved

.php insert text in mysql  / strange characters

Posted on 2007-11-21
4
1,186 Views
Last Modified: 2013-12-12
Hi,

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

Note:
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?
0
Comment
Question by:dwax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:dwax
ID: 20326744

Hmm aparently the same issue appear here...
0
 
LVL 17

Expert Comment

by:psimation
ID: 20326997
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.
0
 

Author Comment

by:dwax
ID: 20327100

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?
0
 

Accepted Solution

by:
dwax earned 0 total points
ID: 20327195

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

That does the trick!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question