yii-users: Database Exception - Can't find tables

I am a newbie to yii although I have a long history or programming and php.

Basically I tried installing the yii-users extension, but it raised a DBException saying it couldn’t find the tables (originally {{users}}, {{profiles}}, and {{profiles_fields}} In the UserModule.php file these are defined. If I change them to ‘users’, ‘profiles’, and ‘profiles_fields’ then everything works.

My first question is why were they originally defined as {{users}}? I think I’m missing a convention here.

Second, what’s the right way to define them? Hopefully with the answer to 1 I could figure out two, but I figure better to ask so then I have an example to look at which could help clarify number 1.

There’s no hurry as I have it working, it just feels like I introduced an ugly hack and since I’m trying to learn the framework its bugging me.

Thanks for the help!


Bill, I’m a newbie myself. The {{…}} allows you to specify a tablePrefix in your …protected/config/main.php file in the ‘db’=>array(…) section. Just add ‘tablePrefix’=>’’, to the file and things will work fine.



Thanks! I thought I had read that it was related to prefix (I’m not using prefixes so I didn’t pay too much attention). I had wondered if double was correct etc.

The ultimate answer was I didn’t have a prefix defined; I would have assumed that it would handle that corner case but it doesn’t. Its unfortunate that if its required to be defined in order for {{}} to work properly (which would be common in modules) they don’t define it by default.

Thanks again!