How can i extract the value that has been taken from database through yii's query builder? below is my code
$value = Yii::app()->db->createCommand()
->select('sum(totalPoints) as pointsSum')
->from('fndn_UserTotal')
->where('userId =:id', array(':id'=>$userId))
//->where('userId = ' . $userId)
->queryRow();
right now, i'm outputting it inside a log in my backend, here is the code.
error_log(print_r($value, true), 3, 'debug.log');
the output will be inside an array. how can i get just the pointSum ? i tried using $value->pointsSum in the above code but it doesnt work.
i want to do something like, echo pointSum;