Warning (512): SQL Error: 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 'AND end_date >= ADDDATE(CURDATE(), 0) ORDER BY `Calendar`.`start_date` ASC LI' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 527]
Code |
Context$sql = "SELECT `Calendar`.`id`, `Calendar`.`user_id`, `Calendar`.`start_date`, `Calendar`.`end_date`, `Calendar`.`repeat_time`, `Calendar`.`title`, `Calendar`.`place`, `Calendar`.`description`, `Calendar`.`category_id`, `Calendar`.`created`, `Calendar`.`modified`, `CalendarCategory`.`id`, `CalendarCategory`.`name`, `CalendarCategory`.`color`, `CalendarCategory`.`repeat_time`, `CalendarCategory`.`created`, `CalendarCategory`.`modified`, `User`.`id`, `User`.`username`, `User`.`passwd`, `User`.`cookie_key`, `User`.`email`, `User`.`activation_string`, `User`.`admin`, `User`.`created`, `User`.`modified` FROM `calendars` AS `Calendar` LEFT JOIN `calendar_categories` AS `CalendarCategory` ON (`Calendar`.`category_id` = `CalendarCategory`.`id`) LEFT JOIN `users` AS `User` ON (`Calendar`.`user_id` = `User`.`id`) WHERE user_id = AND end_date >= ADDDATE(CURDATE(), 0) ORDER BY `Calendar`.`start_date` ASC LIMIT 3"
$error = "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 'AND end_date >= ADDDATE(CURDATE(), 0) ORDER BY `Calendar`.`start_date` ASC LI' at line 1"
$out = null
$out = null;
if ($error) {
trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, line 527
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 203
DboSource::fetchAll() - CORE/cake/libs/model/datasources/dbo_source.php, line 338
DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php, line 655
Model::find() - CORE/cake/libs/model/model.php, line 2031
Model::findAll() - CORE/cake/libs/model/model.php, line 2946
CalendarsController::monthlyView() - APP/controllers/calendars_controller.php, line 151
Object::dispatchMethod() - CORE/cake/libs/object.php, line 116
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
[main] - APP/webroot/index.php, line 88
Query: SELECT `Calendar`.`id`, `Calendar`.`user_id`, `Calendar`.`start_date`, `Calendar`.`end_date`, `Calendar`.`repeat_time`, `Calendar`.`title`, `Calendar`.`place`, `Calendar`.`description`, `Calendar`.`category_id`, `Calendar`.`created`, `Calendar`.`modified`, `CalendarCategory`.`id`, `CalendarCategory`.`name`, `CalendarCategory`.`color`, `CalendarCategory`.`repeat_time`, `CalendarCategory`.`created`, `CalendarCategory`.`modified`, `User`.`id`, `User`.`username`, `User`.`passwd`, `User`.`cookie_key`, `User`.`email`, `User`.`activation_string`, `User`.`admin`, `User`.`created`, `User`.`modified` FROM `calendars` AS `Calendar` LEFT JOIN `calendar_categories` AS `CalendarCategory` ON (`Calendar`.`category_id` = `CalendarCategory`.`id`) LEFT JOIN `users` AS `User` ON (`Calendar`.`user_id` = `User`.`id`) WHERE user_id = AND end_date >= ADDDATE(CURDATE(), 0) ORDER BY `Calendar`.`start_date` ASC LIMIT 3