Salik Asad
Salik Asad

Reputation: 373

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]

I'm working with yii users and rights and following this link, http://www.yiiframework.com/wiki/423/installing-yii-users-and-rights-to-newly-created-yii-app/

I have applied all the things mentioned in this link, but when i type the url localhost/webapp/user/login it asks me to login. Upon login i get this error :

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list'. The SQL statement executed was: SELECT id, username, email, createtime, lastvisit, superuser, status, password, activkey FROM user t WHERE t.username=:yp0 LIMIT 1

Please help me with this..!!

Upvotes: 0

Views: 808

Answers (1)

elixir
elixir

Reputation: 1442

make sure you have a column "id" in the user table. In Yii, id is the default primary key as well

Upvotes: 0

Related Questions