ActiveRecord can't input data with getting no errors at all

I wanted to create a user registration page but it found out a difficult. I can not write in database but can read from it with no problems. also I am getting no error at all when I want to insert via Active Error. here is example of what I am doing


public function actionIndex()

{

    $user = new User;

    $user->username = 'irakli';

    $user->save();

    $this->render('index');

}

This code is NOT working but I am getting no error at all. Please take a note that


$record=User::model()->findByAttributes(array('username'=>$this->username));

$data = $record->id;

$this->render('index', array('data'=>$data));

is working correctly.

If it is important I am using 1and1.com hosting PHP 5.2 and Mysql 5 server

"save" return boolean to inform if it succeeded. Probably you do not meet all validation rules.




public function actionIndex()

{

    $user = new User;

    $user->username = 'irakli';

    if( !$user->save() ) {

       echo CHtml::errorSummary( $user );

    }

    $this->render('index');

}



Thank you for a great help. I know now what was the problem. I had few more variables that couldn’t be blank. So that was a problem


Please fix the following input errors:


Password cannot be blank.

Question cannot be blank.

Answer cannot be blank.

Salt cannot be blank.

Email cannot be blank.

Fullname cannot be blank.

Birth cannot be blank.

Avatar cannot be blank.

About cannot be blank.

Sighnup cannot be blank.

Login cannot be blank.

Status cannot be blank.

Privilages cannot be blank.

Thank you again VERY MUCH :)