-1

Currently in my php file that contains both php and html tags, I am trying to print/echo a variable in Korean from an online database, that uses phpMyAdmin. But whenever I enter a Korean word into a field (안녕) via phpMyAdmin's "insert" button and try to print/echo it out, the output is always ???.

My database, tables and fields all use the collation utf8_general_ci and my php files also contains <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ">. All other Korean text in the php file print fine, so I dont think there is a problem with the meta tag. But whenever I try to print Korean text that is stored inside a table from the database, ??? always prints.

Attempts at a Solution

  • I have tried different Korean words in the field, but it always results in ???.
  • I have tried inserting Korean text (안녕) into the table from inside the php file using the INSERT query, and tried to print/echo that value from the table using SELECT. It prints 안녕 without a problem.
Kingler
  • 5
  • 6

1 Answers1

0

Make sure the column you're inserting to is nchar, nvarchar, or ntext. If you insert a Unicode string into an ANSI column, you really will get question marks in the data.

Also, be careful to check that when you pull the data back out you're not just seeing a client display problem but are actually getting the question marks back:

Ctc
  • 783
  • 5
  • 21