Yii Framework Forum: gii generated code does not save data - Yii Framework Forum

Jump to content

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

gii generated code does not save data mysql tables are not updated Rate Topic: -----

#1 User is offline   frocco 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 225
  • Joined: 17-February 10

Posted 21 July 2010 - 12:19 PM

I generated a crud app using gii.

Nothing gets saved to the database.
I get no errors.

I have a simple table, id and name.
The screen just blinks and clears the field.

Is this a bug, or am I doing something wrong?
Thanks
Regards,

Frank
0

#2 User is offline   amc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 13-March 09

Posted 22 July 2010 - 06:27 AM

Hi

When generating crud the model name is case sensitive. Most likely you have used a lowercase model name as opposed to a proper case model name (i.e. first letter uppercase). This will result in a controller actions looking for a $_POST element with an incorrect name e.g. $_POST[product] as opposed to $_POST[Product]

Regenerate the crud but ensure you use a model name which matches the case of the actual model class

amc

View Postfrocco, on 21 July 2010 - 12:19 PM, said:

I generated a crud app using gii.

Nothing gets saved to the database.
I get no errors.

I have a simple table, id and name.
The screen just blinks and clears the field.

Is this a bug, or am I doing something wrong?
Thanks

0

#3 User is offline   frocco 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 225
  • Joined: 17-February 10

Posted 22 July 2010 - 07:12 AM

View Postamc, on 22 July 2010 - 06:27 AM, said:

Hi

When generating crud the model name is case sensitive. Most likely you have used a lowercase model name as opposed to a proper case model name (i.e. first letter uppercase). This will result in a controller actions looking for a $_POST element with an incorrect name e.g. $_POST[product] as opposed to $_POST[Product]

Regenerate the crud but ensure you use a model name which matches the case of the actual model class

amc

Thank you so much.
Works great now.
Regards,

Frank
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