Jump to content

utf-8 character


divinequran

Recommended Posts

Hi,

 

I have created a db with utf-8, I post the php values with and add those values into a db.

 

$val = $_POST['dbdat'];

 

when i print values got in the variables, it prints the exact value as "£ ". But after inserting this value in DB, it retrieves the value and displays it as some junk character please help.

 

Link to comment
https://forums.phpfreaks.com/topic/179510-utf-8-character/
Share on other sites

You need to check the character encoding of the page you are using to output it (which is probably correct), you will also need to change the character set of the database connection. Have you tried putting...

 

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");

 

...after your mysql_connect statement. Hopefully utf8 is the right value for both, just pulled it off the topic of my head so may not be 100%.

 

Edit: d'oh

Link to comment
https://forums.phpfreaks.com/topic/179510-utf-8-character/#findComment-947215
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.