Database Error
Error:
SQLSTATE[42000] [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 `CategoryCountry`.`in_quick_search` = 1 ORDER BY `CategoryCountry`.`Catego' at line 1
SQL Query:
SELECT `CategoryCountry`.`Id`, `CategoryCountry`.`CategoryID`, `CategoryCountry`.`LanguageID`, `CategoryCountry`.`Category`, `CategoryCountry`.`Created`, `CategoryCountry`.`is_style`, `CategoryCountry`.`is_genre`, `CategoryCountry`.`in_quick_search` FROM `musicfinder`.`category_countries` AS `CategoryCountry` WHERE `CategoryCountry`.`LanguageID` = AND `CategoryCountry`.`in_quick_search` = 1 ORDER BY `CategoryCountry`.`Category` ASC
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 458 → 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 424 → DboSource->_execute(string, array)
$options += array('log' => $this->fullDebug);
$t = microtime(true);
$this->_result = $this->_execute($sql, $params);
'SELECT `CategoryCountry`.`Id`, `CategoryCountry`.`CategoryID`, `CategoryCountry`.`LanguageID`, `CategoryCountry`.`Category`, `CategoryCountry`.`Created`, `CategoryCountry`.`is_style`, `CategoryCountry`.`is_genre`, `CategoryCountry`.`in_quick_search` FROM `musicfinder`.`category_countries` AS `CategoryCountry` WHERE `CategoryCountry`.`LanguageID` = AND `CategoryCountry`.`in_quick_search` = 1 ORDER BY `CategoryCountry`.`Category` ASC'
array()
- CORE/Cake/Model/Datasource/DboSource.php line 666 → DboSource->execute(string, array, array)
if ($cache && ($cached = $this->getQueryCache($sql, $params)) !== false) {
return $cached;
}
$result = $this->execute($sql, array(), $params);
if ($result) {
'SELECT `CategoryCountry`.`Id`, `CategoryCountry`.`CategoryID`, `CategoryCountry`.`LanguageID`, `CategoryCountry`.`Category`, `CategoryCountry`.`Created`, `CategoryCountry`.`is_style`, `CategoryCountry`.`is_genre`, `CategoryCountry`.`in_quick_search` FROM `musicfinder`.`category_countries` AS `CategoryCountry` WHERE `CategoryCountry`.`LanguageID` = AND `CategoryCountry`.`in_quick_search` = 1 ORDER BY `CategoryCountry`.`Category` ASC'
array(
'log' => true
)
array()
- CORE/Cake/Model/Datasource/DboSource.php line 1106 → DboSource->fetchAll(string, array)
// Build SQL statement with the primary model, plus hasOne and belongsTo associations
$query = $this->buildAssociationQuery($Model, $queryData);
$resultSet = $this->fetchAll($query, $Model->cacheQueries);
unset($query);
'SELECT `CategoryCountry`.`Id`, `CategoryCountry`.`CategoryID`, `CategoryCountry`.`LanguageID`, `CategoryCountry`.`Category`, `CategoryCountry`.`Created`, `CategoryCountry`.`is_style`, `CategoryCountry`.`is_genre`, `CategoryCountry`.`in_quick_search` FROM `musicfinder`.`category_countries` AS `CategoryCountry` WHERE `CategoryCountry`.`LanguageID` = AND `CategoryCountry`.`in_quick_search` = 1 ORDER BY `CategoryCountry`.`Category` ASC'
array()
- CORE/Cake/Model/Model.php line 2947 → DboSource->read(CategoryCountry, array)
* @return array
*/
protected function _readDataSource($type, $query) {
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
object(CategoryCountry) {
name => 'CategoryCountry'
useDbConfig => 'default'
useTable => 'category_countries'
id => false
data => array([maximum depth reached])
schemaName => 'musicfinder'
table => 'category_countries'
primaryKey => 'id'
validate => array([maximum depth reached])
validationErrors => array([maximum depth reached])
validationDomain => null
tablePrefix => ''
plugin => null
alias => 'CategoryCountry'
tableToModel => array(
[maximum depth reached]
)
cacheQueries => false
belongsTo => array([maximum depth reached])
hasOne => array([maximum depth reached])
hasMany => array([maximum depth reached])
hasAndBelongsToMany => array([maximum depth reached])
actsAs => null
Behaviors => object(BehaviorCollection) {}
whitelist => array([maximum depth reached])
cacheSources => true
findQueryType => 'all'
recursive => (int) 1
order => null
virtualFields => array([maximum depth reached])
__backAssociation => array([maximum depth reached])
__backInnerAssociation => array([maximum depth reached])
__backOriginalAssociation => array([maximum depth reached])
__backContainableAssociation => array([maximum depth reached])
__safeUpdateMode => false
findMethods => array(
[maximum depth reached]
)
[protected] _schema => array(
[maximum depth reached]
)
[protected] _associationKeys => array(
[maximum depth reached]
)
[protected] _associations => array(
[maximum depth reached]
)
[protected] _insertID => null
[protected] _sourceConfigured => true
[protected] _eventManager => object(CakeEventManager) {}
[protected] _validator => null
}
array(
'conditions' => array(
(int) 0 => 'CategoryCountry.LanguageID = ',
(int) 1 => 'CategoryCountry.in_quick_search = 1'
),
'fields' => array(
(int) 0 => '`CategoryCountry`.`Id`',
(int) 1 => '`CategoryCountry`.`CategoryID`',
(int) 2 => '`CategoryCountry`.`LanguageID`',
(int) 3 => '`CategoryCountry`.`Category`',
(int) 4 => '`CategoryCountry`.`Created`',
(int) 5 => '`CategoryCountry`.`is_style`',
(int) 6 => '`CategoryCountry`.`is_genre`',
(int) 7 => '`CategoryCountry`.`in_quick_search`'
),
'joins' => array(),
'limit' => null,
'offset' => null,
'order' => array(
(int) 0 => 'CategoryCountry.Category ASC'
),
'page' => (int) 1,
'group' => null,
'callbacks' => true
)
- CORE/Cake/Model/Model.php line 2919 → Model->_readDataSource(string, array)
return null;
}
return $this->_readDataSource($type, $query);
}
'all'
array(
'conditions' => array(
(int) 0 => 'CategoryCountry.LanguageID = ',
(int) 1 => 'CategoryCountry.in_quick_search = 1'
),
'fields' => null,
'joins' => array(),
'limit' => null,
'offset' => null,
'order' => array(
(int) 0 => 'CategoryCountry.Category ASC'
),
'page' => (int) 1,
'group' => null,
'callbacks' => true
)
- APP/Controller/PagesController.php line 352 → Model->find(string, array)
'CategoryCountry.in_quick_search = 1'
)
)
);
if(count($CategoryCountry)==0)
'all'
array(
'conditions' => array(
(int) 0 => 'CategoryCountry.LanguageID = ',
(int) 1 => 'CategoryCountry.in_quick_search = 1'
),
'fields' => null,
'joins' => array(),
'limit' => null,
'offset' => null,
'order' => array(
(int) 0 => 'CategoryCountry.Category ASC'
),
'page' => (int) 1,
'group' => null,
'callbacks' => true
)
- [internal function] → PagesController->front_search()
- CORE/Cake/Controller/Controller.php line 490 → ReflectionMethod->invokeArgs(PagesController, array)
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(PagesController) {
uses => array(
[maximum depth reached]
)
components => array(
[maximum depth reached]
)
name => 'Pages'
helpers => array(
[maximum depth reached]
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Pages'
layoutPath => null
viewVars => array(
[maximum depth reached]
)
view => 'front_search'
layout => 'front'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array([maximum depth reached])
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'User'
modelKey => 'page'
validationErrors => null
Session => object(SessionComponent) {}
Auth => object(AuthComponent) {}
Toolbar => object(ToolbarComponent) {}
Countries => object(Countries) {}
Library => object(Library) {}
CategoryCountry => object(CategoryCountry) {}
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
}
array()
- CORE/Cake/Routing/Dispatcher.php line 191 → Controller->invokeAction(CakeRequest)
$response = $controller->response;
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array(
[maximum depth reached]
)
url => 'search/'
base => ''
webroot => '/'
here => '/search/'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
- CORE/Cake/Routing/Dispatcher.php line 165 → Dispatcher->_invoke(PagesController, CakeRequest)
));
}
$response = $this->_invoke($controller, $request);
if (isset($request->params['return'])) {
object(PagesController) {
uses => array(
[maximum depth reached]
)
components => array(
[maximum depth reached]
)
name => 'Pages'
helpers => array(
[maximum depth reached]
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Pages'
layoutPath => null
viewVars => array(
[maximum depth reached]
)
view => 'front_search'
layout => 'front'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array([maximum depth reached])
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'User'
modelKey => 'page'
validationErrors => null
Session => object(SessionComponent) {}
Auth => object(AuthComponent) {}
Toolbar => object(ToolbarComponent) {}
Countries => object(Countries) {}
Library => object(Library) {}
CategoryCountry => object(CategoryCountry) {}
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
}
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array(
[maximum depth reached]
)
url => 'search/'
base => ''
webroot => '/'
here => '/search/'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
- APP/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array(
[maximum depth reached]
)
url => 'search/'
base => ''
webroot => '/'
here => '/search/'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
object(CakeResponse) {
[protected] _statusCodes => array(
[maximum depth reached]
)
[protected] _mimeTypes => array(
[maximum depth reached]
)
[protected] _protocol => 'HTTP/1.1'
[protected] _status => (int) 200
[protected] _contentType => 'text/html'
[protected] _headers => array([maximum depth reached])
[protected] _body => null
[protected] _file => null
[protected] _fileRange => null
[protected] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}