Yii Framework Forum: Problem in the first application with Yii Framework - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem in the first application with Yii Framework Rate Topic: -----

#1 User is offline   William Lepinski 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 19-January 09
  • Location:São Paulo - Brazil

Posted 19 January 2009 - 12:14 PM

I'm following the tutorial for a first application in Yii.. I'm experiencing the following behavior..

When you try to add a new user the framework automatically generate a validation rule for the field ID of the table of users...


Please fix the following input errors:

    * Id cannot be blank.
    * Username cannot be blank.
    * Password cannot be blank.
    * Email cannot be blank.


My DB Config is...


'db'=>array(
'username' => 'root',
'password' => '',
'connectionString'=>'mysql:host=localhost;dbname=yii;',
)


and the SQL is

CREATE TABLE user ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, username VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL );


Any help will be welcome. Thanks.
0

#2 User is offline   jonah 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 733
  • Joined: 27-November 08
  • Location:California (US)

Posted 19 January 2009 - 01:01 PM

What are your validation rules() ?  You can probably simply remove the ID rule.
0

#3 User is offline   Ascomae 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 01-January 09
  • Location:Germany

Posted 19 January 2009 - 05:06 PM

I remember this Problem.

There is a Rule for Field "ID", but there is no Input-Area for the ID.

Just remove the rule, as mentioned before.


Regards,
Christian
0

#4 User is offline   William Lepinski 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 19-January 09
  • Location:São Paulo - Brazil

Posted 20 January 2009 - 04:55 AM

Works!!!

Thanks!!!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users