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 1e42f1516..052101363 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 @@ -6,9 +6,9 @@ $query = new Doctrine_Query(); $query->select('u.*, COUNT(p.id) num_posts') ->from('User u, u.Posts p') ->where('u.id = ?', 1) - ->groupby('u.id') - ->execute(); + ->groupby('u.id'); -echo $query->Posts[0]->num_posts . ' posts found'; +$users = $query->execute(); + +echo $users->Posts[0]->num_posts . ' posts found'; ?> -