CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. The SQL statement executed was: SELECT COUNT(*) FROM `data_Product` `t` WHERE t.status and t.is_removed!=1 and t.parent_Category_id=

/var/www/html/sait/protected/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

#2
+
 /var/www/html/sait/protected/controllers/CatalogController.php(181): CActiveRecord->count(CDbCriteria)
176         }
177         if ($_POST['producer_id']) {
178             $criteria->addCondition('parent_Producer_id= :prod');
179             $criteria->params[':prod'] = (int)$_POST['producer_id'];
180         }
181         $pages = new CPagination(Product::model()->count($criteria));
182         $pages->pageSize = 6;
183         $pages->applyLimit($criteria);
184 
185         $sort = new CSort();
186         $sort->attributes = array(
#12
+
 /var/www/html/sait/index.php(24): CApplication->run()
19     public static function app() {
20         
21         return parent::app();
22     }
23 }
24 Yii::createWebApplication($config)->run();
2024-03-28 18:38:14 Apache/2.2.15 (CentOS) Yii Framework/1.1.10