How can I make my DB connection UTF8 enabled
I have a DB which I've filled using PHPMyAdmin with German paragraphs, and when I try to r开发者_如何转开发etrieve data from DB I only get ?? .. so how can I make sure that the connection to DB is UTF8 enabled?
mysql_set_charset
"Sets the default character set for the current connection."
mysql_client_encoding
"Retrieves the character_set variable from MySQL."
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$charset = mysql_client_encoding($link);
echo "The current character set is: $charset\n";
?>
精彩评论