Cakephp错误:发生了内部错误

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了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中,它解决了我的问题.

脚本宝典总结

以上是脚本宝典为你收集整理的Cakephp错误:发生了内部错误全部内容,希望文章能够帮你解决Cakephp错误:发生了内部错误所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。