CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column '62∏uct_name' in 'where clause'. The SQL statement executed was: SELECT p.id, p.name,p.code, p.price, p.parent_img, p.description, p.structure, c.name as c_name, cat.name as cat_name, lot.warehouse_id as warehouse, GROUP_CONCAT(DISTINCT CONCAT(images.image_path, "," , images.preview_path) SEPARATOR ";") as images
FROM `tbl_product` `p`
JOIN `tbl_colour` `c` ON c.id=p.colour_id
JOIN `tbl_category` `cat` ON cat.id=p.category_id
JOIN `tbl_prihod_lot` `lot` ON lot.product_id = p.id
LEFT JOIN `tbl_product_images` `images` ON images.product_id = p.id
WHERE lot.is_closed = 0 AND lot.count > 0 AND lot.warehouse_id IN('3','5','31','36','37','30') AND (p.name LIKE '%лосины%') AND p.category_id=62∏uct_name=Топ
GROUP BY `code`
ORDER BY `p`.`is_foto` DESC, `lot`.`createDate` DESC

/var/www/anabel/data/www/anabel.biz/yii/framework/db/CDbCommand.php(541)

529         {
530             if($this->_connection->enableProfiling)
531                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
532 
533             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
534             $message=$e->getMessage();
535             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
536                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
537 
538             if(YII_DEBUG)
539                 $message.='. The SQL statement executed was: '.$this->getText().$par;
540 
541             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
542                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
543         }
544     }
545 
546     /**
547      * Builds a SQL SELECT statement from the given query specification.
548      * @param array $query the query specification in name-value pairs. The following
549      * query options are supported: {@link select}, {@link distinct}, {@link from},
550      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
551      * {@link limit}, {@link offset} and {@link union}.
552      * @return string the SQL statement
553      * @since 1.1.6

Stack Trace

#1
+
 /var/www/anabel/data/www/anabel.biz/protected/models/Product.php(291): CDbCommand->queryAll()
286             ->join('tbl_prihod_lot lot', 'lot.product_id = p.id')
287             ->leftJoin('tbl_product_images images', 'images.product_id = p.id')
288             ->where($where)
289             ->group('code')
290             ->order('p.is_foto DESC, lot.createDate DESC')
291             ->queryAll();
292 
293         $dataProvider = new CArrayDataProvider('Product');
294         $dataProvider->setData($products);
295 
296         $pagination = new CPagination();
#2
+
 /var/www/anabel/data/www/anabel.biz/protected/controllers/frontend/SiteController.php(54): Product->searchProductPage("лосины", "62∏uct_name=Топ")
49             $category_id = $_GET['id'];
50         } else {
51             $line_search = $_POST["Product"]["name"];
52         }
53 
54         $dataProvider = Product::model()->searchProductPage($line_search, $category_id);
55 
56         foreach ($dataProvider as &$product) {
57             if ($product['images']) {
58                 $imagesTemp = explode(';', $product['images']);
59                 $product['images'] = array();
#10
+
 /var/www/anabel/data/www/anabel.biz/protected/behaviors/WebApplicationEndBehavior.php(23): CApplication->run()
18         
19 20         $this->onModuleCreate = array($this, 'changeModulePaths');
21         $this->onModuleCreate(new CEvent ($this->owner));
22         
23         $this->owner->run();        
24     }
25     
26 27     public function onModuleCreate($event)
28     {
2024-03-28 17:55:46 Apache/2.2.15 (CentOS) Yii Framework/1.1.13