tablePrefix problem


I was wondered when I tried to configure the tablePrefix property and after that I saw an exception :

"The table "{{users}}" for active record class "Users" cannot be found in the database".

It doesn’t work neither in PDA nor in Active Records. That’s my configuration from main.php file:









Table name is "rtc_users". And i write in SiteController.php:

$connection=new CDbConnection(Yii::app()->db->connectionString, Yii::app()->db->username, Yii::app()->db->password);



$post=new Users;




And that’s models/Users.php file:


class Users extends CActiveRecord


    public static function model($className=__CLASS__)


        return parent::model($className);



    public function tableName()


        return '{{users}}';



Which version Yii you have?

Maybe should be:

public function tableName()


        return '{{Users}}';


I have 1.1.0. “{{Users}}” doesn’t work anyway…

I had the same problem using Postgres, and I believe it’s due to a bug in the way Yii uses the “{{tablename}}” placeholder in PDO named bindings. The value is being bound as “{{tablename}}”, when it should actually be bound as prefix.tablename

If you look at you can see what I did to get it working