Rasmussen:
> So far, I seem to have made the first part work. It's the COUNT() I
> can't really get to work and I'm hoping that some of your guys and
> girls may be of some assistance.
>
> So far, the code I'm trying out with, looks like this:
>
> $select= $this->select(Zend_Db_Table::SELECT_WITH_FROM_PART);
> $select ->setIntegrityCheck(false)
>
> ->where('category_id = ?', $categoryId)
>
> ->join('users_information', 'users_information.id =
> todo_entries.id', array('user_id'=> 'id', 'name', 'username'))
>
> ->join('todo_comments', 'todo_comments.id =
> todo_entries.id', array('num_comments'=> 'COUNT(*)'));
Try (COUNT(*)) instead of COUNT(*). Means, include the parenthesis.
If this doesn't work, try it with a Zend_Db_Expr.
http://framework.zend.com/manual/en/zend.db.select.html#zend.db.select.building.columns-expr
Greetings
Andreas
--
Kraftl EDV - Dienstleistungen
Linux, Linuxschulungen, Webprogrammierung
Autofabrikstraße 16/6
1230 Wien
没有评论:
发表评论