Answer the question
In order to leave comments, you need to log in
Yii2 how to convert array(string) to array(int)?
I make a query to the database
$sql = 'select COUNT(*) from ... // там еще вложенный внутри запрос с группировкой по дате
Yii::$app->db->createCommand($sql)->queryColumn();
Answer the question
In order to leave comments, you need to log in
php seems to always give strings from the muscle (not sure)
use (int) or intval()
type casting
Well, let's start with the fact that you want to get count (*), where the array was drawn from, I don’t know, maybe sql will give more understanding
This is for extracting 1 scalar value, count is just right =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question