Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cdbexception When I Want To Save A Model

$
0
0
Hi,

I can't save a model, I just wanna update a column value in my MySql. In native PHP I can do in easily, but in Yii no, and I can't solution on the internet.


145                 {
146                     $turn=Turn::model()->find("`setting`='current_turn'");
147                     $turn->attributes=array('value'=>'200');
148                     $turn->update();                   
149                 }

The problem is at the 148. line, with the update method. So the Yii can find the model, it is not empty. But can't update, and I don't know why, this codesnippet I found here on the forum as a right solution, but it seems I use in the bad way...

The error message only is:
Column name must be either a string or an array.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>