mysql does not update record


When I try and update a record from the gii generated code, the page refreshes and nothing is saved.

It is a required field, and if I leave it blank, I get no error when I hit the save button.

What am I doing wrong?

Have the column in db been defined as not null before you generated code with gii?

if not, then try again generating code after defining the column as not null.

first the model and then the crud-code.

in the model there will be rules for the columns in the db and then you get some errormessages if you leave fields blank.

The SysID field is defined as not null in the table.

My rules:

public function rules()


		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

		return array(

			array('SysID', 'required'),

			array('SysID', 'length', 'max'=>10),

			// The following rule is used by search().

			// Please remove those attributes that should not be searched.

			array('id, SysID', 'safe', 'on'=>'search'),



It still is not working, I get no error message.

I had this problem too, it turned out the $_POST[‘variable’] had the first letter in uppercase so it could never read the data because in the controller it was looking for the ‘variable’ in all lower case