Crud & Primary Key Problem

Hi,

I’m a newbie, and 'ive starting learning yii with the documentation.

I’m trying to implement the CRUD with yiic shell.

The first step worked perfectly (model User tbl_user)

But the second step (crud User)returns an error : "tbl_user" does not have a primary key.

I’ve created the table with auto_increment, and phpmyadmin confirms the fact that there IS a primary key.

Does anyone know how to solve this problem?

Thanks!

assign a primary key and then create the model again.

then create the CRUD.

I’ve already assigned a primary key, and it still won’t work…

This screenshot is in french, i’m sorry

Try using Gii instead of console. If it’s the same, please provide table creation SQL (can be exported via phpmyadmin).

try with gii

enable gii in main config .

I think you must delete old file model, because gii read from model you have created in folder model,