Update Record not Working


I just don’t know what is going on here. I get no errors in the log files.

I have this code inside my controller:

$companyrecord = Company::find()

		->where(['id' => $session['company_id']])


$companyrecord->pay_count = 300;


When I do this before the save() it show the correct information with the value set to 300:


But then doing this:


It shows false.

I am forcing the value of the column to 300, but it does nothing. The default is set to start at 1 and every time I run this code, it stays at 1, it never gets set to 300.

Any ideas?


if method save() return false. Try this

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



Thank you, that showed me the error and I was able to fix it.