Unable to save a model by assigning values to each attributes in Yii -


 $model=new testmodel;  $data = $_get['data'];                     //get json object ajax request   $record = json_decode($data);              //convert json objects  $model->url = $record['info']['bg'];       //assign url   $model->user_id = 123;                     //assign user id   $model->save(); 

the error says: cannot use object of type stdclass array in.

can explain me why error occurs? new yii

$record = json_decode($data, true);    mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] ) 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -