<?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_wcjx_conn = "localhost"; $database_wcjx_conn = "dbName"; $username_wcjx_conn = "root"; $password_wcjx_conn = "12345678"; $wcjx_conn = mysql_pconnect($hostname_wcjx_conn, $username_wcjx_conn, $password_wcjx_conn) or trigger_error(mysql_error(),E_USER_ERROR); // 加上這一段就OK了 mysql_query("SET CHARACTER SET utf8",$wcjx_conn); mysql_query("SET CHARACTER_SET_database= utf8",$wcjx_conn); mysql_query("SET CHARACTER_SET_CLIENT= utf8",$wcjx_conn); mysql_query("SET CHARACTER_SET_RESULTS= utf8",$wcjx_conn); ?>