CDbException

CDbCommand không thể thi hành câu truy vấn SQL: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '9625,9581,9623,9622,9582,9619,9604,9614,9583,9585,9609,9594,9607,9606,9615,95...' at line 1. The SQL statement executed was: SELECT COUNT(DISTINCT `t`.`record_id`) FROM `dos_module_products` `t` LEFT OUTER JOIN `dos_module_products_cat` `ProductsCat` ON (`t`.`dos_module_item_cat_cat_id`=`ProductsCat`.`cat_id`) WHERE (enable=1 AND dos_module_item_cat_cat_id in (,9625,9581,9623,9622,9582,9619,9604,9614,9583,9585,9609,9594,9607,9606,9615,9584,9603,9617,9601,9600,9599,9598,9596,9595,9586,9593,9591,9590,9589,9588,9608,9624,9620,9612,9578,9605,9575,9577,9576,9574,9573))

/home/web79/public_html/framework/db/CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#4
+
 /home/web79/public_html/protected/modules/products/models/Products.php(283): CActiveRecord->count(CDbCriteria)
278             $criteria->select = 'record_id, title,pic_thumb,pic_full, unit, record_order, hot, enable,tag';
279             $criteria->order = 'record_order DESC, postdate DESC';
280             $criteria->condition = 'enable=1 AND dos_usernames_username=:user';    
281             $criteria->params = array(':user' => $this->_subdomain);            
282         }
283         $count = $this->model()->count($criteria);    
284         // elements per page
285         $pages = new CPagination($count);
286         $pages->pageSize = Yii::app()->controller->configs['products_num_paging_cat'];
287         $pages->applyLimit($criteria);
288 
#5
+
 /home/web79/public_html/protected/modules/products/controllers/DefaultController.php(27): Products->listItemByCat(",9625,9581,9623,9622,9582,9619,9604,9614,9583,9585,9609,9594,960...")
22         $arr_id=$info_cat['cat_id'].",";
23         foreach($arr_cat as $v){
24             $arr_id .=$v['cat_id'].",";
25         }        
26         $arr_id=substr($arr_id,0,-1);
27         $this->render(Yii::app()->session['template'] . '/cats', array('info_cat' => $info_cat, 'list_sub_cats' => $arr_cat, 'list_items' => $model_class->listItemByCat($arr_id)));
28     }
29 
30     public function actionView($id) {
31         $model = ucfirst($this->module->id);
32         $model_class = new $model();
#15
+
 /home/web79/public_html/index.php(13): CApplication->run()
08     $config = dirname(__FILE__) . '/protected/config/dev.php';
09     defined('YII_DEBUG') or define('YII_DEBUG', true);
10     defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
11 }
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 21:43:21 Apache Yii Framework/1.1.12