各位大大,帮忙看一下我在数据库中新建了一个detail表,是用来描述产品信息的,有个introduce字段,用的是gb2312_chinese_ci格式,在phpMyAdmin中添加和查找都没问题,显示中文正常,但是在php代码中用 $params['detail_list'] = $detail->fetchAll($where);语句查找出来的introduce字段是乱码,一串 ??????????????我html页面的格式是 gb2312的:<head>
<meta http-equiv = "Content-Type" content="text/h;charset=gb2312"/>
<meta http-equiv = "Content-Type" content="text/h;charset=gb2312"/>
还有你程序的编码也要设为gb2312,用你的编辑器设置。
用了 set names gb2312 这一句,页面还是有问题,
还有程序的编码怎么设置,我用的是zend studio
通过配置文件的方式链接数据库,
还不知道具体在哪一步链接的,
所以我在查询语句
$params['detail_list'] = $detail->fetchAll($where);
之前使用了 set names gb2312,页面还是不能正常显示还有我的编辑器是zend studio 怎么改程序的编码
通过配置文件的方式链接数据库,
还不知道具体在哪一步链接的,
所以我在查询语句
$params['detail_list'] = $detail->fetchAll($where);
之前使用了 set names gb2312,页面还是不能正常显示还有我的编辑器是zend studio 怎么改程序的编码
后
echo base64_encode( $params['detail_list'] );
帖出结果