chinese chars OK in phpmyadmin but ??? on regular php page

chinese chars OK in phpmyadmin but ??? on regular php page

am 12.02.2007 15:52:40 von Loc108

I have mysql 5 and php 5.1.2 with chinese chars in utf8 on mysql.
Browsing the tables in phpmyadmin shows correct chinese characters.
However, a custom php page to display them shows only ???

At the top of my php page I did include:

www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
dir="ltr">



Any help?

Thanks!

Re: chinese chars OK in phpmyadmin but ??? on regular php page

am 12.02.2007 23:11:09 von Loc108

try

http://forums.devshed.com/php-development-5/utf-8-problems-m ysql-and-php-401164.html?&highlight=php+utf-8+mysql

basically change:


mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );

// continue script...

?>

to


mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );

// set utf8 unicode mode

mysql_query ( 'SET NAMES utf8' );

// continue script...

?>


On Feb 12, 6:52 am, Loc...@gmail.com wrote:
> I have mysql 5 and php 5.1.2 with chinese chars in utf8 on mysql.
> Browsing the tables in phpmyadmin shows correct chinese characters.
> However, a custom php page to display them shows only ???
>
> At the top of my php page I did include:
>
>
> > dir="ltr">
>
>
>
> Any help?
>
> Thanks!