2008年10月20日星期一

Re: [fw-db] Zend_Db and mysql_set_charset();

If you have PDO installed, you can do the following:

$pdoOptions = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'");

$dbOptions = array(
'host' => 'xx.xx.xx.xx',
'username' => 'xxxxx',
'password' => 'xxxxxx',
'dbname' => 'xxxxxx',
'driver_options' => $pdoOptions
);

$db = Zend_Db::factory("Pdo_Mysql", $dbOptions);

-Mark

FYI- If you haven't found it already, this list is archived at:
http://www.nabble.com/Zend-Framework-Community-f16154.html nabble.com . A
little searching there will usually find the answer faster than asking it
again :-) --M

Alex Zinchenko wrote:
>
> Good day.
>
> I have some troubles with my MySQL charset and i know that
> mysql_set_charset() function can help me.
> How to make it work with Zend_Db ?
>
> Best regards,
> Alex.
>


-----
Mark Garrett
DailyDNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
--
View this message in context: http://www.nabble.com/Zend_Db-and-mysql_set_charset%28%29--tp20063642p20082726.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: