Error Info: Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column '36А' in 'where clause'
)
in /local/www/board.orsk.ru/vendor/yiisoft/yii2/db/Command.php at line 822
$exceptionClass = '\yii\db\Exception';
foreach ($this->exceptionMap as $error => $class) {
if (strpos($e->getMessage(), $error) !== false) {
$exceptionClass = $class;
}
}
$message = $e->getMessage() . "\nThe SQL being executed was: $rawSql";
$errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;
return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e);
}
/**
* Returns a value indicating whether a SQL statement is for read purpose.
* @param string $sql the SQL statement
* @return boolean whether a SQL statement is for read purpose.
*/
public function isReadQuery($sql)
{
$this->pdoStatement->closeCursor();
}
Yii::endProfile($token, 'yii\db\Command::query');
} catch (\Exception $e) {
Yii::endProfile($token, 'yii\db\Command::query');
throw $this->db->getSchema()->convertException($e, $rawSql);
}
if (isset($cache, $cacheKey, $info)) {
$cache->set($cacheKey, [$result], $info[1], $info[2]);
Yii::trace('Saved query result in cache', 'yii\db\Command::query');
}
* @return string|null|boolean the value of the first column in the first row of the query result.
* False is returned if there is no value.
* @throws Exception execution failed
*/
public function queryScalar()
{
$result = $this->queryInternal('fetchColumn', 0);
if (is_resource($result) && get_resource_type($result) === 'stream') {
return stream_get_contents($result);
} else {
return $result;
}
}
return $data;
}
public static function getHouseNumber($id_house){
$house='';
if((int)$id_house>0){
$house=\Yii::$app->getDb()->createCommand('SELECT name FROM {{%address_house}} WHERE id='.$id_house)->queryScalar();
}
return $house;
}
}
$params=BoardParams::getParamsView($item);
if(!empty($params['params'])){
$item=\yii\helpers\ArrayHelper::merge($item,$params['params']);
}
if ( (int)$item['estate_map_street'] ) {
$item['estate_map_house']=AddressHouse::getHouseNumber($item['estate_map_house']);
$item['estate_map_street']=AddressStreet::getStreetName($item['estate_map_street']);
}
/*
\common\models\BoardCountersAds::updateHits($id);
\common\models\BoardCountersAdsTotal::updateHits($id);