English 中文(简体)
CakePHP 2. 成 辛
原标题:CakePHP Count syntax

我在卡纳克民阵写了一封信,需要获得一个形象职位。 其一(age)与许多(com)联系。

我曾尝试过以下工作,但努力工作,因为它无法找到桌子? 我知道,我已设法在以前的申请中只问过Kingk。

这是法典。

$data = $this->Image->find( all , array(
 fields  => array( COUNT(Comment.comment_id) AS total ,  Image.* ),
 group  => array( Image.logo_id )
));

我基本上想得出图像细节,然后发表与图像相关的评论。

希望的人能够提供帮助。

感谢。

最佳回答
问题回答

暂无回答




相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签