Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 316197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:21:42+00:00 2026-05-12T08:21:42+00:00

I’m trying to insert some japanese words in a mysql table! If I insert

  • 0

I’m trying to insert some japanese words in a mysql table!
If I insert ‘こんにちは’ using phpMyAdmin, the word is displayed fine from phpMyAdmin.
But if I try to insert it through php, as follow:

mysql_connect($Host, $User, $Password);
mysql_select_db($Database);

$qry = "INSERT INTO table VALUES (0 , 'こんにちは')";

echo mysql_query($qry);

In phpMyAdmin i see “ã“ã‚“ã«ã¡ã¯” … why?

And if I try to fetch from the database:

$arr = mysql_fetch_array(mysql_query("SELECT * FROM table where id = 1"));

echo $arr[1];

The browser shows nothing!!!

How can I solve?

Thank you in advance for your help!!!


~EDIT~

My database collation is setup to utf8_general_ci


~EDIT 2~

I don’t need to display the output on an HTML page, but the japanese words are printed on a XML page whose encoding is setup to UTF-8.

$plist = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$plist .= "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n";
$plist .= "<plist version=\"1.0\">\n";
$plist .= "<array>\n";
$plist .= "\t<dict>\n";
$plist .= "\t\t<key>test</key>\n";
$plist .= "\t\t<string>".$arr[1]."</string>\n";
$plist .= "\t</dict>\n";
$plist .= "</array>\n";
$plist .= "</plist>";

echo $plist;

the output of this code is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
        <key>test</key>
        <string></string>
    </dict>
</array>
</plist>

So, there is no value for the key “test” … what can I do? Thanks!


~ SOLVED ~

Problems solved using the function mysql_set_charset() after connecting to the database!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:21:43+00:00Added an answer on May 12, 2026 at 8:21 am

    try this before the insert query

    mysql_query("SET NAMES utf8");
    

    Also not sure if you set the proper charset of the database, and of the web page.

    Charset in HTML Head section?

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    

    and/or something like

       header( 'Content-Type: text/html; charset=utf-8' );
    

    Followings will help you get more ideas how to do it .. if something doesnt work commment back.

    check more here on SO

    Storing and displaying unicode string (हिन्दी) using PHP and MySQL

    How to make MySQL handle UTF-8 properly

    setting utf8 with mysql through php

    PHP/MySQL with encoding problems

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 174k
  • Answers 174k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SELECT StudentID, [Date], MAX(Event) AS [Event] FROM MyTable GROUP BY… May 12, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer Use this answer for Rails 2, otherwise see below for… May 12, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer If you want to pass data between scripts in PHP… May 12, 2026 at 2:49 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.