当前位置:Gxlcms > 数据库问题 > Cannot use object of type yii\db\Connection as array

Cannot use object of type yii\db\Connection as array

时间:2021-07-01 10:21:17 帮助过:3人阅读

$pointLog = $conn->createCommand(‘select * from table1 where is_deleted = 0 AND id1 = :id1 AND id2 = :Id2‘,
    [":id1" => $Id1, ":id2" => $Id2])->queryAll();

  如果少了这个 queryAll 就会报这种错误。因为不是一个结果集,后面的代码又会引用当做行来用,php 报错很奇葩。

Cannot use object of type yii\db\Connection as array

标签:

人气教程排行