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!
Page 1 of 1
Crud & Primary Key Problem
#2
Posted 17 July 2013 - 07:26 AM
klemmy, on 17 July 2013 - 07:22 AM, said:
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!
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.
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
Wiwo inc.
| Mobile: 919995504508
#3
Posted 17 July 2013 - 07:51 AM
I've already assigned a primary key, and it still won't work...
This screenshot is in french, i'm sorry
This screenshot is in french, i'm sorry
Attached File(s)
-
Capture1.PNG (115.84K)
Number of downloads: 23
#4
Posted 17 July 2013 - 09:11 AM
Try using Gii instead of console. If it's the same, please provide table creation SQL (can be exported via phpmyadmin).
Yii 2.0 Development Cookbook
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
#5
Posted 18 July 2013 - 12:42 AM
klemmy, on 17 July 2013 - 07:51 AM, said:
I've already assigned a primary key, and it still won't work...
This screenshot is in french, i'm sorry
This screenshot is in french, i'm sorry
try with gii
enable gii in main config .
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
Wiwo inc.
| Mobile: 919995504508
#6
Posted 28 August 2013 - 05:12 AM
I think you must delete old file model, because gii read from model you have created in folder model,
Share this topic:
Page 1 of 1