Call Now & Start Saving on Golf Today!
800-321-8269
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 's Creek G & CC' ORDER BY distance' at line 1
SQL Query:
SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance
Notice:
If you want to customize this error message, create app/View/Errors/pdo_error.ctp
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 437 → PDOStatement->execute(array)
try {
$query = $this->_connection->prepare($sql, $prepareOptions);
$query->setFetchMode(PDO::FETCH_LAZY);
if (!$query->execute($params)) {
$this->_results = $query;
- CORE/Cake/Model/Datasource/DboSource.php line 403 → DboSource->_execute(string, array)
$options += array('log' => $this->fullDebug);
$t = microtime(true);
$this->_result = $this->_execute($sql, $params);
'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
array()
- CORE/Cake/Model/Datasource/DboSource.php line 647 → DboSource->execute(string, array, array)
if ($cache && ($cached = $this->getQueryCache($sql, $params)) !== false) {
return $cached;
}
if ($result = $this->execute($sql, array(), $params)) {
$out = array();
'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
array()
array()
- CORE/Cake/Model/Datasource/DboSource.php line 516 → DboSource->fetchAll(string)
$recursive = null;
if (count($args) === 1) {
return $this->fetchAll($args[0]);
} elseif (count($args) > 1 && (strpos($args[0], 'findBy') === 0 || strpos($args[0], 'findAllBy') === 0)) {
'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
- [internal function] → DboSource->query(string)
'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
- CORE/Cake/Model/Model.php line 3010 → call_user_func_array(array, array)
public function query($sql) {
$params = func_get_args();
$db = $this->getDataSource();
return call_user_func_array(array(&$db, 'query'), $params);
}
array(
(int) 0 => object(Mysql) {},
(int) 1 => 'query'
)
array(
(int) 0 => 'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
)
- APP/Controller/CoursesController.php line 372 → Model->query(string)
$theQuery = "SELECT *, gpsDistance(lat,lng,{$lat},{$lng}) as distance FROM courses Course WHERE";
$theQuery .= " gpsDistance(lat,lng,{$lat},{$lng}) <= {$within} AND name != '" . $course_data['Course']['name'] . "'";
$theQuery .= " ORDER BY distance";
$results = $this->Course->query($theQuery);
'SELECT *, gpsDistance(lat,lng,34.2019,-82.2311) as distance FROM courses Course WHERE gpsDistance(lat,lng,34.2019,-82.2311) <= 50 AND name != 'Hunter's Creek G & CC' ORDER BY distance'
- [internal function] → CoursesController->nearby(string)
- CORE/Cake/Controller/Controller.php line 485 → ReflectionMethod->invokeArgs(CoursesController, array)
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(CoursesController) {
name => 'Courses'
chars => 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
validation_code_len => (int) 6
components => array(
)
menu_items => null
info_area => array(
)
nbr_name => array(
)
error => array(
)
success => array(
)
uses => array(
)
helpers => array(
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Courses'
layoutPath => null
viewVars => array(
)
view => 'nearby'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
)
scaffold => false
methods => array(
)
modelClass => 'Course'
modelKey => 'course'
validationErrors => null
MemberAuth => object(MemberAuthComponent) {}
Session => object(SessionComponent) {}
UserAuth => object(UserAuthComponent) {}
Email => object(EmailComponent) {}
Course => object(Course) {}
}
array(
(int) 0 => '2182'
)
- CORE/Cake/Routing/Dispatcher.php line 103 → Controller->invokeAction(CakeRequest)
$controller->startupProcess();
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'courses/nearby/2182'
base => ''
webroot => '/'
here => '/courses/nearby/2182'
}
- CORE/Cake/Routing/Dispatcher.php line 85 → Dispatcher->_invoke(CoursesController, CakeRequest, CakeResponse)
));
}
return $this->_invoke($controller, $request, $response);
}
object(CoursesController) {
name => 'Courses'
chars => 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
validation_code_len => (int) 6
components => array(
)
menu_items => null
info_area => array(
)
nbr_name => array(
)
error => array(
)
success => array(
)
uses => array(
)
helpers => array(
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Courses'
layoutPath => null
viewVars => array(
)
view => 'nearby'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
)
scaffold => false
methods => array(
)
modelClass => 'Course'
modelKey => 'course'
validationErrors => null
MemberAuth => object(MemberAuthComponent) {}
Session => object(SessionComponent) {}
UserAuth => object(UserAuthComponent) {}
Email => object(EmailComponent) {}
Course => object(Course) {}
}
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'courses/nearby/2182'
base => ''
webroot => '/'
here => '/courses/nearby/2182'
}
object(CakeResponse) {
}
- APP/webroot/index.php line 96 → Dispatcher->dispatch(CakeRequest, CakeResponse)
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'courses/nearby/2182'
base => ''
webroot => '/'
here => '/courses/nearby/2182'
}
object(CakeResponse) {
}