【发布时间】:2014-06-11 13:46:59
【问题描述】:
我是 yii 的新手,如何使用 yii 进行查询?
查询是:
从 table1、table2、table3 中选择 table1.userid 作为 userid,table2.name 作为用户名,table3.name 作为 tourname,其中 table1.userid=table2.id 和 table1.tid=table3.id order by table1.weight, table1.result
谢谢, 莱斯利
【问题讨论】:
-
你不想使用 activerecords 或者只想知道如何在 Yii 中执行这种格式的查询?
-
Yii::app()->db->createCommand("select table1.userid as userid, table2.name as username, table3.name as tourname from table1, table2, table3 where table1.userid=table2.id and table1.tid=table3.id order by table1.weight, table1.result")->queryAll()。如果没有 AR。