2009年7月15日星期三

Re: [fw-db] Zend_Db + MySQL + New MVC Model

Hi,

if you are using Zend_Application, use the charset-parameter in your
config, e.g. in a ini-file:

[production]
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "YOURUSER"
resources.db.params.password = "YOURPASS"
resources.db.params.dbname = "YOURDB"
resources.db.params.charset = utf8
resources.db.isDefaultTableAdapter = true

Does that answer your question?
Regards,
Uli

Mauro Spivak wrote:
> Hi guys,
>
> I'm starting a new development on the lastest ZF (1.8). Seems like the
> MVC suggested structure changed a bit and DBs are now "factored"
> internally by the framework. Am I right? Where should I place the old
> "SET NAMES 'utf8'" in order to get MySQL properly working with UTF8? I
> used to place it in the bootstrap but now it's a class and I don't know
> how to instantiate the DB adapter from there.
>
> Do I make myself clear? The question is: How to get MySQL properly
> working with UTF8 in the new MVC structure?
>
> Cheers,
>
> Mauro

没有评论: