0
我也同時Yii的2對象無法轉換爲字符串
使用查詢得到這個錯誤這是我的SQL查詢代碼:
<?php $fines=Yii::$app->db->createCommand('select sum(fines) as fines from lib_chekout '); ?>
這在這裏我使用了$罰款變量代碼:
<h4 class="pull-left" style="font-size: 20px"> Total fines Collected Till Today : </h4> <p class="text-center" style="font-size: 20px"> <?= $fines ?> </p>
現在的問題是,它顯示錯誤
無法將類yii \ db \ Command的對象轉換爲字符串
如何解決此問題?