[SOLVED] CDbConnection exception upon SET NAMES

Did anyone of you experience problems during initialization of your database connection?

I'm working with yii 1.0.6, started on my windows machine (latest XAMPP) where everything went fine. Then I moved my application to the server (MySQL-Version: 5.0.32-Debian_7etch8) where I came accross some errors. I tracked it down to CDbConnection::initConnection, where the following throws an exception:



<?php


$stmt=$pdo->prepare('SET NAMES ?');


$stmt->execute(array($this->charset));


?>


If I change the code to



<?php


$pdo->exec("SET NAMES '{$this->charset}'");


?>


It works as expected (well, at least it doesn't crash).

Did you set 'emulatePrepare'=>true in your app config for the db connection?

Nope, I didn't.

Thanks for your fast reply, works as expected with that option turned on. :)