Solved

.php insert text in mysql  / strange characters

Posted on 2007-11-21
4
1,178 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP script redirecting to URL not working on AWS EC2 after Elastic IP 12 65
updating the date data 12 25
datetime in sql 6 29
.htaccess 5 12
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now