Mysql Database

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|

This is very strange. One more to do, could you please show the result of executing "SHOW COLUMNS FROM user"?

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

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?

ah, yes, check your User class' tableName() method. I guess you didn't generate this class correctly.

Where can I find it?

In your User.php file.

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';


}

What is your error message now when using crud command? I'm confused…

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.

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?

Are there any validation errors? Did you override beforeValidate or beforeSave?

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.