douruoshen1449 2014-12-14 15:46
浏览 34
已采纳

php pear字符编码

I have some issue with pear since i am beginner in it. Two characters(ő and ü) which is correctly stored in the db appearing on the php page as ?.

I was able to write out correctly the characters in a normal php page by:

mysqli_query($dbc,'SET NAMES UTF8');

This solved that problem but i don't know how to use this in pear.

I use this command for sql accesing

$dg->bind('SELECT * FROM person', $options, 'MDB2');

I try to use this analog:

 $dg->bind('SET NAMES UTF8', $options, 'MDB2');

but this isn't working gives me MDB2 Error: unknown error.

  • 写回答

1条回答 默认 最新

  • duankuai6586 2014-12-14 17:03
    关注
    1. Extend class from Structures_DataGrid_DataSource_MDB2 to get acces to protected _connect() function
    2. Take instantiated databased object like that

      //fill all needed options to create object $dataSource = new Structures_DataGrid_DataSource_MDB2_Extended(); $mdb2 = $dataSource->connect(); $mdb2->exec("SET NAMES utf8");

    3. Bind created data source to your Structures_DataGrid with bindDataSource

    4. Run $dg->bind('SELECT * FROM person', $options, 'MDB2');

    Something like that. I don't check that code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 Matlab联合CRUISE仿真编译dll文件报错
  • ¥15 脱敏项目合作,ner需求合作
  • ¥15 脱敏项目合作,ner需求合作
  • ¥30 Matlab打开默认名称带有/的光谱数据
  • ¥50 easyExcel模板 动态单元格合并列
  • ¥15 res.rows如何取值使用
  • ¥15 在odoo17开发环境中,怎么实现库存管理系统,或独立模块设计与AGV小车对接?开发方面应如何设计和开发?请详细解释MES或WMS在与AGV小车对接时需完成的设计和开发
  • ¥15 CSP算法实现EEG特征提取,哪一步错了?
  • ¥15 游戏盾如何溯源服务器真实ip?需要30个字。后面的字是凑数的
  • ¥15 vue3前端取消收藏的不会引用collectId