Database Error
Error:
SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'hydrobio.TaxonInvertebre.rang' which is not in SELECT list; this is incompatible with DISTINCT
SQL Query:
SELECT DISTINCT `TaxonInvertebre`.`code_sandre`, `TaxonInvertebre`.`nom` FROM `hydrobio`.`releve_invertebre` AS `ReleveInvertebre` LEFT JOIN `hydrobio`.`taxon_invertebre` AS `TaxonInvertebre` ON (`TaxonInvertebre`.`code_sandre` = `ReleveInvertebre`.`code_sandre`) WHERE `ReleveInvertebre`.`liste_id` IN (10805, 12708, 12717, 21156) ORDER BY `TaxonInvertebre`.`rang` 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 502 → PDOStatement->execute()
try {
$query = $this->_connection->prepare($sql, $prepareOptions);
$query->setFetchMode(PDO::FETCH_LAZY);
if (!$query->execute($params)) {
$this->_result = $query;
- CORE/Cake/Model/Datasource/DboSource.php line 468 → DboSource->_execute()
$options += array('log' => $this->fullDebug);
$t = microtime(true);
$this->_result = $this->_execute($sql, $params);
- CORE/Cake/Model/Datasource/DboSource.php line 715 → DboSource->execute()
if ($cache && ($cached = $this->getQueryCache($sql, $params)) !== false) {
return $cached;
}
$result = $this->execute($sql, array(), $params);
if ($result) {
- CORE/Cake/Model/Datasource/DboSource.php line 1226 → DboSource->fetchAll()
// 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);
- CORE/Cake/Model/Model.php line 3053 → DboSource->read()
* @return array
*/
protected function _readDataSource($type, $query) {
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
- CORE/Cake/Model/Model.php line 3025 → Model->_readDataSource()
return null;
}
return $this->_readDataSource($type, $query);
}
- APP/Controller/ListesinvertebresController.php line 421 → Model->find()
$taxons = $this->ReleveInvertebre->find("all", array(
"fields" => array("DISTINCT TaxonInvertebre.code_sandre", "TaxonInvertebre.nom"),
"conditions" => array("ReleveInvertebre.liste_id" => $id),
"order" => "TaxonInvertebre.rang ASC"
));
- [internal function] → ListesinvertebresController->inventaire()
- CORE/Cake/Controller/Controller.php line 499 → ReflectionMethod->invokeArgs()
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
- CORE/Cake/Routing/Dispatcher.php line 193 → Controller->invokeAction()
$response = $controller->response;
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
- CORE/Cake/Routing/Dispatcher.php line 167 → Dispatcher->_invoke()
));
}
$response = $this->_invoke($controller, $request);
if (isset($request->params['return'])) {
- APP/webroot/index.php line 110 → Dispatcher->dispatch()
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);