From 3b1a2e77d4a49ca8dbb921d72dc17569ed9763b3 Mon Sep 17 00:00:00 2001 From: hansbrix Date: Thu, 12 Apr 2007 17:09:14 +0000 Subject: [PATCH] added output example of aggregate --- ...e) - SELECT queries - Aggregate values.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/manual/codes/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php b/manual/codes/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php index 9be313891..1e42f1516 100644 --- a/manual/codes/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php +++ b/manual/codes/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php @@ -1,11 +1,14 @@ -select('u.*, COUNT(p.id) num_posts') - ->from('User u, u.Posts p') - ->where('u.id = ?', 1) - ->groupby('u.id') - ->execute(); -?> +select('u.*, COUNT(p.id) num_posts') + ->from('User u, u.Posts p') + ->where('u.id = ?', 1) + ->groupby('u.id') + ->execute(); + +echo $query->Posts[0]->num_posts . ' posts found'; +?> +