2 years ago

#438

test-img

Sanjeev Divekar

CakePHP3 query object returns wrong datatype

Query object return avg rating is 3 instead of 3.5, when I have 4 and 3 values for ratings in the table

        $query = $Comments->find()
            ->select(['rating'=>'AVG(rating)'])
            ->first();

cakephp

cakephp-3.0

0 Answers

Your Answer

Accepted video resources