Exception
lithium\data\model\QueryException
(code 1064)
SELECT * FROM `tours` AS `Tours` WHERE end_date >= SUBDATE(CURDATE(), 10) AND `Tours`.`is_active` = 'yes' AND `Tours`.`is_public` = 'yes' AND (destination_id = ) ORDER BY `Tours`.`start_date` ASC;: 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 ') ORDER BY `Tours`.`start_date` ASC' at line 1
Source
Stack Trace
-
[exception]
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/Database.php: 1607
1602 protected function _error($sql){ 1603 $params = compact('sql'); 1604 1605 return Filters::run($this, __FUNCTION__, $params, function($params) { 1606 list($code, $error) = $this->error(); 1607 throw new QueryException("{$params['sql']}: {$error}", $code); 1608 }); 1609 } 1610 1611 /** 1612 * Applying a strategy to a `lithium\data\model\Query` object
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 231
226 */ 227 public static function run($class, $method, array $params, $implementation) { 228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /**
-
lithium\data\source\Database::_error()
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/Database.php: 1608
1603 $params = compact('sql'); 1604 1605 return Filters::run($this, __FUNCTION__, $params, function($params) { 1606 list($code, $error) = $this->error(); 1607 throw new QueryException("{$params['sql']}: {$error}", $code); 1608 }); 1609 } 1610 1611 /** 1612 * Applying a strategy to a `lithium\data\model\Query` object 1613 *
-
lithium\data\source\database\adapter\MySql::lithium\data\source\database\adapter\{closure}() @ ?
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/database/adapter/MySql.php: 407
402 $params['options']['buffered'] 403 ); 404 try { 405 $resource = $this->connection->query($params['sql']); 406 } catch (PDOException $e) { 407 $this->_error($params['sql']); 408 }; 409 return Libraries::instance(null, 'result', compact('resource'), $this->_classes); 410 }); 411 } 412
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 231
226 */ 227 public static function run($class, $method, array $params, $implementation) { 228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /**
-
lithium\data\source\database\adapter\MySql::_execute()
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/database/adapter/MySql.php: 410
405 $resource = $this->connection->query($params['sql']); 406 } catch (PDOException $e) { 407 $this->_error($params['sql']); 408 }; 409 return Libraries::instance(null, 'result', compact('resource'), $this->_classes); 410 }); 411 } 412 413 /** 414 * Gets the last auto-generated ID from the query that inserted a new record. 415 *
-
lithium\data\source\Database::read()::{closure} @ 583
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/Database.php: 599
594 if (!$data = $this->_queryExport($query)) { 595 return false; 596 } 597 $sql = $this->renderCommand($data['type'], $data); 598 } 599 $result = $this->_execute($sql); 600 601 if ($return === 'resource') { 602 return $result; 603 } 604 if ($return === 'item') {
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 231
226 */ 227 public static function run($class, $method, array $params, $implementation) { 228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /**
-
lithium\data\source\Database::read()
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/source/Database.php: 636
631 } 632 if (is_object($query) && $query->with()) { 633 $model::embed($collection, $query->with(), ['return' => $return]); 634 } 635 return $collection; 636 }); 637 } 638 639 /** 640 * Helper method for `Database::read()` to export query while handling additional joins 641 * when using relationships and limited result sets. Filters conditions on subsequent
-
lithium\data\Model::find()::{closure} @ 635
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/Model.php: 616
611 612 $implementation = function($params) use ($self, $meta) { 613 $options = $params['options'] + ['type' => 'read', 'model' => $meta['name']]; 614 $query = Libraries::instance(null, 'query', $options, $self->_classes); 615 616 return static::connection()->read($query, $options); 617 }; 618 if (isset($self->_finders[$type])) { 619 $finder = $self->_finders[$type]; 620 621 $reflect = new \ReflectionFunction($finder);
-
lithium\data\Model::lithium\data\{closure}() @ ?
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/Model.php: 731
726 protected static function _finders() { 727 $self = static::object(); 728 729 return [ 730 'all' => function($params, $next) { 731 return $next($params); 732 }, 733 'first' => function($params, $next) { 734 $options =& $params['options']; 735 $options['limit'] = 1; 736
-
lithium\data\Model::find()::{closure} @ 635
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/Model.php: 636
631 get_called_class(), __FUNCTION__, $params, $implementation, [$finder] 632 ); 633 } 634 635 $implementation = function($params) use ($finder, $implementation) { 636 return $finder($params, $implementation); 637 }; 638 } 639 return Filters::run(get_called_class(), __FUNCTION__, $params, $implementation); 640 } 641
-
lithium\aop\Chain::__invoke()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Chain.php: 156
151 if (($filter = next($this->_filters)) !== false) { 152 return $filter($params, $this); 153 } 154 155 $implementation = $this->_implementation; 156 return $implementation($params); 157 } 158 159 /* Deprecated / BC */ 160 161 /**
-
lithium\core\Libraries::app\models\{closure}() @ ?
/home/marabb9/naturalistjourneys.com/app/models/Tours.php: 387
382 } 383 384} 385 386Filters::apply(Tours::class, 'find', function($params, $next) { 387 $response = $next($params); 388 389 // Check if single or multiple results and respond accordingly 390 if (!method_exists($response, 'map')) { 391 $records = new Collection(array('data' => array($response))); 392 } else {
-
lithium\aop\Chain::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Chain.php: 123
118 */ 119 public function run(array $params, $implementation) { 120 $this->_implementation = $implementation; 121 122 $filter = reset($this->_filters); 123 $result = $filter($params, $this); 124 125 $this->_implementation = null; 126 return $result; 127 } 128
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 233
228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /** 237 * Clears filters optionally constrained by class or class and method combination. 238 *
-
lithium\data\Model::find()
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/Model.php: 639
634 635 $implementation = function($params) use ($finder, $implementation) { 636 return $finder($params, $implementation); 637 }; 638 } 639 return Filters::run(get_called_class(), __FUNCTION__, $params, $implementation); 640 } 641 642 /** 643 * Sets or gets a custom finder by name. The finder definition can be an array of 644 * default query options, or an anonymous functions that accepts an array of query
-
lithium\data\Model::__callStatic()
/home/marabb9/naturalistjourneys.com/libraries/lithium/data/Model.php: 467
462 $params = [$params[1] + [$method => $params[0]]]; 463 } 464 if ($params && !is_array($params[0])) { 465 $params[0] = ['conditions' => static::key($params[0])]; 466 } 467 return $self::find($method, $params ? $params[0] : []); 468 } 469 preg_match('/^findBy(?P<field>\w+)$|^find(?P<type>\w+)By(?P<fields>\w+)$/', $method, $args); 470 471 if (!$args) { 472 $message = "Method `%s` not defined or handled in class `%s`.";
-
app\controllers\DestinationsController::view()
/home/marabb9/naturalistjourneys.com/app/controllers/DestinationsController.php: 59
54 'end_date >= SUBDATE(CURDATE(), 10)', 55 'is_active' => 'yes', 56 'is_public' => 'yes', 57 $tour_destination_conditions 58 ), 59 'order' => 'start_date ASC' 60 )); 61 62 if ($destination->slug == 'mexico-caribbean' OR $destination->slug == 'south-america') { 63 $trinidad_tobago = Destinations::first(array( 64 'conditions' => array(
-
lithium\action\Controller::__invoke()::{closure} @ 197
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Controller.php: 211
206 if (!method_exists($this, $action)) { 207 throw new DispatchException("Action `{$action}` not found."); 208 } 209 $this->_render['template'] = $this->_render['template'] ?: $action; 210 211 if ($result = call_user_func_array(array($this, $action), $args)) { 212 if (is_string($result)) { 213 $this->render(['text' => $result]); 214 return $this->response; 215 } 216 if (is_array($result)) {
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 231
226 */ 227 public static function run($class, $method, array $params, $implementation) { 228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /**
-
lithium\action\Controller::__invoke()
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Controller.php: 225
220 221 if (!$this->_render['hasRendered'] && $this->_render['auto']) { 222 $this->render(); 223 } 224 return $this->response; 225 }); 226 } 227 228 /** 229 * This method is used to pass along any data from the controller to the view and layout 230 *
-
lithium\action\Dispatcher::lithium\action\{closure}() @ ?
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Dispatcher.php: 277
272 */ 273 protected static function _call($callable, $request, $params) { 274 $params = compact('callable', 'request', 'params'); 275 return Filters::run(get_called_class(), __FUNCTION__, $params, function($params) { 276 if (is_callable($callable = $params['callable'])) { 277 return $callable($params['request'], $params['params']); 278 } 279 throw new DispatchException('Result not callable.'); 280 }); 281 } 282}
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 231
226 */ 227 public static function run($class, $method, array $params, $implementation) { 228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /**
-
lithium\action\Dispatcher::_call()
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Dispatcher.php: 280
275 return Filters::run(get_called_class(), __FUNCTION__, $params, function($params) { 276 if (is_callable($callable = $params['callable'])) { 277 return $callable($params['request'], $params['params']); 278 } 279 throw new DispatchException('Result not callable.'); 280 }); 281 } 282} 283 284
-
lithium\action\Dispatcher::run()::{closure} @ 154
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Dispatcher.php: 169
164 165 if (!$params) { 166 throw new DispatchException('Could not route request.'); 167 } 168 $callable = static::_callable($result, $params, $options); 169 return static::_call($callable, $result, $params); 170 }); 171 } 172 173 /** 174 * Attempts to apply a set of formatting rules from `$_rules` to a `$params` array, where each
-
lithium\aop\Chain::__invoke()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Chain.php: 156
151 if (($filter = next($this->_filters)) !== false) { 152 return $filter($params, $this); 153 } 154 155 $implementation = $this->_implementation; 156 return $implementation($params); 157 } 158 159 /* Deprecated / BC */ 160 161 /**
-
/home/marabb9/naturalistjourneys.com/app/config/bootstrap/action.php::{closure} @ 43
/home/marabb9/naturalistjourneys.com/app/config/bootstrap/action.php: 45
40 continue; 41 } 42 $file = "{$config['path']}/config/routes.php"; 43 file_exists($file) ? call_user_func(function() use ($file) { include $file; }) : null; 44 } 45 return $next($params); 46 }); 47 48 /** 49 * This filter protects against HTTP host header attacks, by matching the `Host` header 50 * sent by the client against a known list of good hostnames. You'll need to modify
-
lithium\aop\Chain::__invoke()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Chain.php: 152
147 * @return mixed The return value of the next filter. If there is no 148 * next filter, the return value of the implementation. 149 */ 150 public function __invoke(array $params) { 151 if (($filter = next($this->_filters)) !== false) { 152 return $filter($params, $this); 153 } 154 155 $implementation = $this->_implementation; 156 return $implementation($params); 157 }
-
lithium\core\ErrorHandler::apply()::{closure} @ 242
/home/marabb9/naturalistjourneys.com/libraries/lithium/core/ErrorHandler.php: 246
241 242 Filters::apply($class, $method, function($params, $next) use ($conditions, $handler) { 243 $wrap = static::$_exceptionHandler; 244 245 try { 246 return $next($params); 247 } catch (Exception $e) { 248 if (!static::matches($e, $conditions)) { 249 throw $e; 250 } 251 return $handler($wrap($e, true), $params);
-
lithium\aop\Chain::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Chain.php: 123
118 */ 119 public function run(array $params, $implementation) { 120 $this->_implementation = $implementation; 121 122 $filter = reset($this->_filters); 123 $result = $filter($params, $this); 124 125 $this->_implementation = null; 126 return $result; 127 } 128
-
lithium\aop\Filters::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/aop/Filters.php: 233
228 $implementation = static::_bcImplementation($class, $method, $params, $implementation); 229 230 if (!static::hasApplied($class, $method)) { 231 return $implementation($params); 232 } 233 return static::_chain($class, $method)->run($params, $implementation); 234 } 235 236 /** 237 * Clears filters optionally constrained by class or class and method combination. 238 *
-
lithium\action\Dispatcher::run()
/home/marabb9/naturalistjourneys.com/libraries/lithium/action/Dispatcher.php: 170
165 if (!$params) { 166 throw new DispatchException('Could not route request.'); 167 } 168 $callable = static::_callable($result, $params, $options); 169 return static::_call($callable, $result, $params); 170 }); 171 } 172 173 /** 174 * Attempts to apply a set of formatting rules from `$_rules` to a `$params` array, where each 175 * formatting rule is applied if the key of the rule in `$_rules` is present and not empty in
-
[main]
/home/marabb9/naturalistjourneys.com/app/webroot/index.php: 43
38 * @see lithium\action\Response 39 * @see lithium\action\Dispatcher 40 * @see lithium\net\http\Router 41 * @see lithium\action\Controller 42 */ 43 echo lithium\action\Dispatcher::run(new lithium\action\Request()); 44 45