php+mysql:网页和数据库均采用utf8编码,数据库内容在网页上正常显示,但导入excel,中文变成问号了 5
$result=mysql_query("SELECT*FROMcomputer");//返回结果集for($i=0;$i<mysql_num_fields($resul...
$result = mysql_query("SELECT * FROM computer");//返回结果集
for ($i=0;$i<mysql_num_fields($result);$i++)
{
$column_name[$i]= mysql_field_name($result,$i);
}
$table[0]=$column_name;
for($i=1;$row = mysql_fetch_array($result);$i++)
{
$table_record[0]=iconv("utf-8", "gbk", $row['BookName']);
$table_record[1]=iconv("utf-8", "gbk", $row['BookPrice']);
$table_record[2]=iconv("utf-8", "gbk", $row['BuyTime']);
$table[$i]= $table_record;
} 展开
for ($i=0;$i<mysql_num_fields($result);$i++)
{
$column_name[$i]= mysql_field_name($result,$i);
}
$table[0]=$column_name;
for($i=1;$row = mysql_fetch_array($result);$i++)
{
$table_record[0]=iconv("utf-8", "gbk", $row['BookName']);
$table_record[1]=iconv("utf-8", "gbk", $row['BookPrice']);
$table_record[2]=iconv("utf-8", "gbk", $row['BuyTime']);
$table[$i]= $table_record;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询