MySQL Forums
Forum List  »  PHP

Asian language problems
Posted by: James Hill
Date: February 27, 2009 07:53PM

Right, I'm having some rather strange issues between mysql and php when it comes to inserting Japanese text. I have the table and fields set to utf8_unicode_ci, if I use phpmyAdmin to insert japanese text through the interface it works just fine. If I use phpmyadmin but type in the mysql insert command in the interface it works just fine. If I use php to connect to the database and insert the text I get what looks like the ascii codes in the record rather than the text.


Is converted to :

The php I'm using is:

$link = mysql_connect($DBhost,$DBuser,$DBpass);
$db_selected = mysql_select_db($DBName, $link);
if (!$db_selected) { die ('Database access error : ' . mysql_error());}

$query = "INSERT INTO `QuestionsJA` (ID, QuestionText, AnswerText, Correct, Type, QGroup, Active) VALUES ('$QID','$QText', '$Ans', '$Cor', '$Type', '$QGroup', '$Active')";

mysql_query($query) or die('Error, Feedback insert into database failed')

I can output the variables containing the text into the browser and it displays as it should, just seems to be the communication between php and mysql.

Please help, this is driving me nuts.


Options: ReplyQuote

Written By
Asian language problems
February 27, 2009 07:53PM
February 28, 2009 03:11PM
March 04, 2009 04:25PM
March 04, 2009 10:49PM
March 05, 2009 11:39AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.