调用函数到模型时出现此错误.
Database Error
Error: SQLSTATE[42000]: Syntax error or access violation: 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 'singleBlockWeekly' at line 1
SQL Query: singleBlockWeekly
这是我的控制器
class BlackoutController extends CalendarAppController
{
var $uses = array('Studio','Blackout','BlackoutRepeatTypeDetails','Calendar.Event');
var $components = array('Accesscontrol','RequestHandler');
function event_checker()
{
$start_date = $this->request->data['start_date'];
$end_date = $this->request->data['end_date'];
$endsOn = $this->request->data['endsOn'];
$repeatType = $this->request->data['repeatType'];
$blockType = $this->request->data['blockType'];
$frequency = $this->request->data['freq'];
$repeatDays = $this->request->data['repeatDays'];
#single type
if($blockType == "single"){
if($repeatType == "weekly"){
$dates = $this->Blackout->singleBlockWeekly($start_date,$endsOn,$repeatDays,$frequency);
debug($dates);
die;
}
}
}
}
这是我的模特
class Blackout extends CalendarAppModel
{
var $name = 'Blackout';
var $useTable = false;
function singleBlockWeekly($startDate,$endDate,$repeatEvery = array(),$freq)
{
/*my code here...brevity...*/
}
}
所以我在这里只是在停电模型中调用singleBlockWeekly函数.我想知道即使在singleBlockWeekly函数上没有任何与SQL相关的代码,为什么也会收到奇怪的SQL错误?
对你的帮助表示感谢!谢谢!