I want to count the rows where id is let's say 32 with this command:
$countReviews = Yii::$app->db->createCommand("SELECT COUNT(*)
FROM `product_review`
WHERE `product_review`.`product_id`=$book->id")->execute();
There is no rows in the table but this returns 1 as result. Why is that ? Is this the right way to do the task?Thank you!