shinokada
(Okada Shin)
21
mysql>USE yiisource
Database changed
mysql> SHOW CREATE TABLE User
Tabel | Create Table
User | CREATE TABLE 'user' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'username' varchar(120) NOT NULL,
'password' varchar120) NOT NULL,
PRIMARY KEY ('id'))
ENGINE=MyISAM DEFAULT CHARSET =latin 1|
qiang
(Qiang Xue)
22
This is very strange. One more to do, could you please show the result of executing "SHOW COLUMNS FROM user"?
shinokada
(Okada Shin)
23
Field | Type | Null | Key | Default | Extra
id int(11) No PRI Null auto_increment
username verchar(128) No Null
password varchar(120) No Null
email varchar(120) No Null
Spyros
(Spyros)
24
Quote
>> crud User
I get this error message this time.
Error: Table "generate" does not have a primary key.
Oh my.
Why the error is table "generate"?
Shouldn't be table "users"?
Is there a "generate" table in your db?
qiang
(Qiang Xue)
25
ah, yes, check your User class' tableName() method. I guess you didn't generate this class correctly.
shinokada
(Okada Shin)
28
I found User.php under testdrive\protected\models.
And tableName() method is the following.
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'user';
}
qiang
(Qiang Xue)
29
What is your error message now when using crud command? I'm confused…
shinokada
(Okada Shin)
30
sorry of all of this.
I just did exactly what I did before, following the docmentation.
Then it worked this time.
Thank for your patience.
I will carry through quick start in the docementation.
I appreciate your help and time.
shinokada
(Okada Shin)
31
However I am not able to add any new users.
After adding some then when I see User List or managing user, I see nothing.
I checked db and there are no data.
Now what is wrong?
qiang
(Qiang Xue)
32
Are there any validation errors? Did you override beforeValidate or beforeSave?
shinokada
(Okada Shin)
33
After logging in as admin. going to …?r=user/create to create a new user.
After clicking Creat, going to the same page, …r=user/create.
Then clicking User List or Manage User. There is no list. No record in db either.
I don't get any error message throughout.