php - Adding Data with Yii Framework -
this user table structure :
+----------------+------------------+------+-----+---------+----------------+ | field | type | null | key | default | | +----------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | no | pri | null | auto_increment | | screen_name | varchar(20) | no | uni | null | | | slug | varchar(20) | no | | null | | | email | varchar(50) | no | uni | null | | | pass | varchar(32) | yes | | null | | | signin_twitter | enum('t','f') | no | | f | | | twitter_id | int(11) | yes | uni | null | | | bg_image | varchar(50) | yes | | null | | +----------------+------------------+------+-----+---------+----------------+
i'm trying add data database. (in controller)
$model=new users; //$this->performajaxvalidation($model); if(isset($_post['users'])) { //screen_name, email,pass comes form. also, need set **slug** , **singin_twitter** $_post['users']['slug'] = $this->sanitize($_post['users']['screen_name']); $_post['users']['signin_twitter'] = 'f'; $model->attributes=$_post['users']; if($model->save()) $this->redirect('dash/index'); }
but it's not saving data . $model->save() returning false
. how can debug ?
yii debug tool bar debug tool yii-debug-toolbar download page
Comments
Post a Comment