Cakephp错误:发生了内部错误

前端之家收集整理的这篇文章主要介绍了Cakephp错误:发生了内部错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在cakePHP中有一些代码会产生错误.

这是PHP控制器:

$this->loadModel( 'Vote' ); //Newly added by amit start
$vote=$this->Vote->getVote($id,$uid);
$this->set('vote',$vote);
$voteCount = count($vote);
$this->set('voteCount',$voteCount);

$voteShow = $this->Vote->find('all',array(
    'fields' => array('SUM(Vote.score)   AS score','count(id) as countId'),'conditions'=>array('Vote.type_id'=>$id),));
$this->set('voteShow',$voteShow);

模型:

public function getVote($id,$uid) {
    if (empty($conditions))
        $conditions = array('Vote.type' => 'blog','Vote.type_id' => $id,'Vote.user_id' => $uid);

    $users = $this->find('all',array('conditions' => $conditions,'order' => 'Vote.id desc'
    ));
    return $users;
}

代码产生此错误

Error : An internal error has occurred

这个错误是什么意思?

我启用了调试模式:Configure :: write(‘debug’,2);在core.PHP中,它解决了我的问题.
原文链接:https://www.f2er.com/php/135939.html

猜你在找的PHP相关文章