2012-02-21 94 views
0

我试图创造CakePHP的1.3的插件,但我有以下错误是令人沮丧的我:CakePHP的1.3插件:数据库错误

1064: You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the 
right syntax to use near 'process' at line 1 

我已经试过许多东西,但还没有拿出一个办法;

基本上我打电话从我app_controller.php文件中的以下内容:

var $uses = array('Visitor.Visitors'); 

function beforeRender(){ 
    $this->Visitors->process($this->here); 
} 

然后,我已经在我的visitor.php模型文件按照我的插件

class Visitor extends VisitorsAppModel { 
    var $name = 'Visitor'; 

    function process($url = null){ 
     $this->deleteInactive(); 
     if($this->_isBot() == FALSE){ 
      $this->_updateVisitor($url); 
     } 
    } 
} 

奇怪的是即使我注释掉上述函数,我仍然会得到相同的MySQL错误1064.

帮助!

回答

0

尝试将$this->Visitors->process($this->here);中的“访问者”更改为“访问者”(单数)。

0

这也似乎你已经在$uses阵列的app_controller.php文件的交换中 '访问者' 和 '访问者':

var $uses = array('Visitor.Visitors'); 

应该

var $uses = array('Visitors.Visitor');