Database Error
Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'news' in 'where clause'
SQL Query:
SELECT `News`.`id`, `News`.`year`, `News`.`month`, `News`.`day`, `News`.`kind`, `News`.`title`, `News`.`text`, `News`.`open`, `News`.`modified`, `News`.`created` FROM `koujirushi`.`news` AS `News` WHERE `News`.`id` = news LIMIT 1
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/NewsController.php line 258 → Model->find()
$modelClass = $this->modelClass;
$this->$modelClass->id = $id;
$conditions = "News.id = {$id}";
$data = $this->$modelClass->find("first", array("conditions" => $conditions));
if (!$data) {
- [internal function] → NewsController->detail()
- 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'])) {
- /var/www/vhosts/koujirushi.jp/httpdocs/index.php line 97 → Dispatcher->dispatch()
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse());