|
Posted by Loc108 on February 12, 2007, 5:11 pm
Please log in for more thread options
try
http://forums.devshed.com/php-development-5/utf-8-problems-mysql-and-php-401164.html?&highlight=php+utf-8+mysql
basically change:
<?php
mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );
// continue script...
?>
to
<?php
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:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
> dir="ltr">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> Any help?
>
> Thanks!
|