0
votes

I am attempting to create a plugin for CakePHP 1.3, but I am having the following error that is frustrating me:

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

I have tried multiple things but have not come up with a solution;

Basically I call the following from my app_controller.php file:

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

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

And then I have the following in my visitor.php model file in my plugin

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

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

The strange thing is that even if I comment out the above function I still get the same MySQL error 1064.

Help!

2

2 Answers

0
votes

Try changing 'Visitors' in $this->Visitors->process($this->here); to 'Visitor' (singular).

0
votes

It seems also that you have swapped 'Visitors' and 'Visitor' in the $uses array of your app_controller.php file:

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

should be

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