开发者

Insert special characters to database in Zend

开发者 https://www.devze.com 2023-04-06 07:31 出处:网络
I Try to add following form array to data base in the Zend freamwork Db_abstract function ($db->insert($data))

I Try to add following form array to data base in the Zend freamwork Db_abstract function ($db->insert($data))

$data = array(
    [name] => Dinuka
    [special_request] => I'm Dinuka Ö é Ñ Thilanga 
)

But special_request values did not insert correctly. It insert only 'I'm Dinuka'. Other values are drop when insert the query.

I set following prams in my application.ini

resources.db.adapter = PDO_MYSQL
resources.db.params.host = 192.168.0.xxx
开发者_JAVA百科resources.db.params.username = xxxxx
resources.db.params.password = xxxxx
resources.db.params.dbname = xxxxx
resources.db.params.charset = utf8

Please help me. How I insert special values into the database as correct way.


Are you try to insert this utf-8 query from Command Line?

Maybe The problem is with postgres DB and not related to Zend adapter...


set the field's Collation as utf8_general_ci and try inserting again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号