Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2011, 03:11 PM
hike73 hike73 is offline
Junior Member
 
Join Date: May 2011
Posts: 3
Default Chinese Character not display from MySQL database to PHP web page

I'm newbie to using Resin with Quercus.

I have written PHP web pages for my web site, data retrieved from MySQL, and will doing some processing to the data by calling Java classes.

I'm using Resin 4.0.15, PHP 5.3.2, MySQL 5.5, and JDK 1.6.0_25.

I have written my database, table, and column in UTF-8 character set.

I have changed to this [default_charset = "utf-8"] in my "php.ini"

In my PHP script web page, when I connect my database, I have added SOME following query before getting the database:

Code:
$connection = mysql_connect('localhost', 'root_username', 'root_password');
mysql_query("SET NAMES 'UTF8'");
mysql_select_db("database_name");
On my web page, I got " ? " on every chinese character words.
I have modified many places for UTF8 display such as character set in Database for connection, client, result. All failed to display the chinese character.

I need to display my Chinese Character that stored in MySQL database and display them correctly on web page via Resin.
I have trying Apache TOMCAT to read the chinese charaacter and was successed but unfortunately I do not know JSP.
I feel Resin is convenient for me to handle Java with PHP, but too bad that cannot displaying Chinese character on my web page.

Please kindly advise me as soon as possible (ASAP).
Reply With Quote
  #2  
Old 05-11-2011, 09:34 PM
dicr dicr is offline
Junior Member
 
Join Date: Jan 2011
Location: Donetsk, Ukraine
Posts: 11
Send a message via ICQ to dicr Send a message via Skype™ to dicr
Default

See my last post in thread: http://forum.caucho.com/showthread.php?t=4564
  1. use characterSetResult=utf8 in driver url
  2. use "/*!40101 SET NAMES utf8 */" instead of "SET NAMES utf8"
  3. use unicode.semantics=on
Reply With Quote
  #3  
Old 05-14-2011, 03:00 AM
hike73 hike73 is offline
Junior Member
 
Join Date: May 2011
Posts: 3
Default

dicr,

Sorry, I don't get from you.

How to setup "1. use characterSetResult=utf8 in driver url " ?

Is it setup like this "mysql_query("/*!40101 SET NAMES 'utf8' */" " in my PHP script ?

Where to setup "3. use unicode.semantics=on " ?
Reply With Quote
  #4  
Old 05-14-2011, 03:15 AM
dicr dicr is offline
Junior Member
 
Join Date: Jan 2011
Location: Donetsk, Ukraine
Posts: 11
Send a message via ICQ to dicr Send a message via Skype™ to dicr
Default

Hello, hike73
Look at my post http://forum.caucho.com/showpost.php...9&postcount=13
Reply With Quote
  #5  
Old 05-14-2011, 05:13 AM
hike73 hike73 is offline
Junior Member
 
Join Date: May 2011
Posts: 3
Default

Thanks dicr,

It works fantastically !! It's finally work on displaying any unicode character as I wanted !

Thank you so much !!
Reply With Quote
Reply

Tags
chinese character, mysql, mysql encode utf8, php, utf8

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.