從我的數據庫中讀取特殊字符後,顯示不正確。mysql不讀取特殊字符utf8(øœå)
我連接到我的數據庫以這種方式:
$link = mysql_connect($db_host,$db_user,$db_pass) or die('Unable to establish a DB connection');
mysql_select_db($db_database,$link);
mysql_query("SET names UTF8");
?>
我以這種方式讀取數據庫:
$rs = mysql_query("SELECT id, name FROM tags ");
while($row = mysql_fetch_array($rs))
{
//Read each tag into a span-menu
echo "<div class=\"span-3\"id=\"".$row['id']."\">"."<a href=\"activities.php?tag_id=".$row['id']."&tag=".$row['name']."\"><h5>".$row['name']."</h5></a></div>\n ";
}
表包含正確的字符,所以這個問題是當他們閱讀....
任何想法?
THX
你看到了什麼,你應該看到什麼? – Esailija