日期:2014-05-17 浏览次数:20558 次
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
$sqlb = "create table test ( ..... ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;"; [b]3,连接数据库时,定义编码:[/b] [code=PHP] $conn=mysql_connect($host,$user,$pwd); mysql_query("SET character_set_connection=utf-8, character_set_results=utf-8, character_set_client=binary",$conn);
$conn=mysql_connect($host,$user,$pwd); mysql_query("SET character_set_connection=utf-8,//这里的utf-8改写成utf8 character_set_results=utf-8,//同上 character_set_client=binary",$conn);
------解决方案--------------------