From 24621c3dd11b095620615362bf897098f39c8f06 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 2 Dec 2013 07:29:46 -0500 Subject: [PATCH] improved doc --- framework/yii/db/Query.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/yii/db/Query.php b/framework/yii/db/Query.php index 870c66d..301b2e1 100644 --- a/framework/yii/db/Query.php +++ b/framework/yii/db/Query.php @@ -23,10 +23,13 @@ use yii\base\Component; * * ~~~ * $query = new Query; + * // compose the query * $query->select('id, name') * ->from('tbl_user') * ->limit(10); * // build and execute the query + * $rows = $query->all(); + * // alternatively, you can create DB command and execute it * $command = $query->createCommand(); * // $command->sql returns the actual SQL * $rows = $command->queryAll();