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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.