Click here to get back home

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

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
chinese chars OK in phpmyadmin but ??? on regular php page Loc108 02-12-2007
Posted by Loc108 on February 12, 2007, 9:52 am
Please log in for more thread options
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!


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!



Similar ThreadsPosted
how to store chinese chars and also italian, french and english in mysql ? July 25, 2006, 4:02 am
I want to create something like AMAZON: those who liked page A also liked page B October 26, 2005, 2:09 pm
help,a regular text file how to sql 2000 table code ? April 6, 2008, 1:01 am
Hex instead of chars problem April 12, 2006, 3:26 pm
Importing chinese characters July 10, 2006, 4:36 am
Storing and outputting Polish chars with MySql v5.0 and ASP June 27, 2006, 3:19 pm
The most optimize way to store and seach chinese character in MySQL 4.1 July 14, 2005, 5:11 am
Login page perl/CGI April 27, 2007, 1:53 am
Importing with phpMyAdmin February 8, 2007, 9:40 pm
phpmyadmin: size unknown July 19, 2005, 4:35 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap