MInor fix to syntax.
This commit is contained in:
parent
cd8452aa8b
commit
d82f539d8d
1 changed files with 4 additions and 4 deletions
|
@ -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';
|
||||
?>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue