tags:

views:

220

answers:

3

Yii Crud is ENRAGINGME

I did

yiic shell "/path/to/my/app"

model *

crud users

I cannot add or update users. I can list them, and delete them. Also I thought I was supposed to see the primary keys and shit wtf homie

wtf

CREATE TABLE IF NOT EXISTS `users` (
  `user_id` int(11) NOT NULL auto_increment,
  `user_username` varchar(25) collate latin1_general_ci NOT NULL,
  `user_username_clean` varchar(25) collate latin1_general_ci NOT NULL,
  `user_password` varchar(64) collate latin1_general_ci NOT NULL,
  `user_register_time` int(11) NOT NULL,
  `user_code` varchar(15) collate latin1_general_ci NOT NULL,
  PRIMARY KEY  (`user_id`)
) ENGINE=InnoDB;
+1  A: 

Probable reason could be DB username/password which you have provided in config/main.php doesn't have access to modify database. Just making a guess, post more details about the issue to better understand it.

hnprashanth
A: 

It looks like the suggestion about database permissions above was the answer, but just a friendly note: the newer versions of Yii have a new visual (GUI) CRUD generator called "Gii". Check out the instructions here, it's much nicer than yiic and may solve some problems creating CRUD code:

http://www.yiiframework.com/doc/guide/quickstart.first-app#generating-crud-code

thaddeusmt
A: 

i just followed this tutorial step-by-step an everything is working fine except i cant update, delete an db entry. always error 404 or 400.

after creating a user: url-shown-in-the-browser: localhost/index.php?r=users/view&id=user1 html: Error 404 error: exception.CHttpException.404 : http://pastebin.com/8bfQ1GxP

4F2E4A2E