小编Sar*_*voo的帖子

Mysql计数按组发生

嗨我有关于mysql DB的下表.

?????????????????????????????????????????????????
? REVIEW_ID ? USER_ID ? STATUS ?   DATE_ADDED   ?
?????????????????????????????????????????????????
?       218 ?       2 ? cool   ? 20130121134811 ?
?       218 ?       2 ? cool   ? 20130121134812 ?
?       218 ?       2 ? lame   ? 20130121134813 ?
?       218 ?       2 ? funny  ? 20130121134814 ?
?       218 ?       2 ? funny  ? 20130121134815 ?
?       218 ?       2 ? funny  ? 20130121134816 ?
?       218 ?       2 ? lame   ? 20130121134817 ?
?????????????????????????????????????????????????
Run Code Online (Sandbox Code Playgroud)

我怎么能得到一个结果,当我根据user_id我需要得到每种类型的总状态的结果进行查询时: …

mysql sql select

5
推荐指数
1
解决办法
4200
查看次数

Zend Framework调用另一个Controller Action

嗨,我有问题调用另一个控制器动作发送邮件,这是我的代码:

user.php的

public function followAction()
{
     $follow_id = $this->_getParam('id');
     $response = "<a href='javascript: void(0)'  class='i-wrap ig-wrap-user_social i-follow_small-user_social-wrap'><i class='i i-follow_small-user_social ig-user_social'></i>Stop Following</a>";

     notifyEmail()  ------> need to call Notity Controller with notifyEmail() Action along with           
                       params
     $this->_helper->json($response);  ----> return json response
}
Run Code Online (Sandbox Code Playgroud)

NotifyController.php

<?php

class NotifyController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */

    }

     public function index()
    {

    }

     public function notifyEmailAction()
    {
          // rest of email code goes here
    }

}
Run Code Online (Sandbox Code Playgroud)

感谢帮助!

php zend-framework

2
推荐指数
1
解决办法
2万
查看次数

c ++将函数传递给主错误

嗨,我有以下c ++代码,我希望调用函数进入main,以下是我的代码:

#include <iostream>
#include <numeric>

int main()
{

    using namespace std;

    readData();

    int sumA = accumulate(A, A + sizeof(A) / sizeof(int), 0);
    int sumB = accumulate(B, B + sizeof(B) / sizeof(int), 0);

    cout << ((sumA > sumB) ? "Array A Greater Than Array B\n" : "Array B Greater Than Array A\n");


    return 0;
}

void readData()
{

int A[] = { 1, 1, 8};
int B[] = { 2, 2, 2};
}
Run Code Online (Sandbox Code Playgroud)

我在cli上有以下错误:

test.cpp:3:7: error: storage size of ‘B’ …
Run Code Online (Sandbox Code Playgroud)

c++

0
推荐指数
1
解决办法
127
查看次数

标签 统计

c++ ×1

mysql ×1

php ×1

select ×1

sql ×1

zend-framework ×1