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 * FROM `goods` `t` WHERE category in ()

/var/www/jungsu/data/www/jung.su/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

#5
+
 /var/www/jungsu/data/www/jung.su/protected/controllers/SeriesController.php(573): CDataProvider->getData()
568         $frameCats = Categories::model()->findAll(array('condition' => 'series=' . $series, 'order' => '`device`,`order_device`,`name` ASC'));
569         $criteriaAll->condition = 'category in (' . join(',', array_column($frameCats, 'id')) . ')';
570 
571         $framesAll = new CActiveDataProvider('Goods', array('criteria' => $criteriaAll, 'pagination' => false));
572         $allAttributesIds = [];
573         foreach ($framesAll->getData() as $item) {
574             !in_array($item->typeframe, $allAttributesIds) && $allAttributesIds[] = $item->typeframe;
575         }
576 
577         $result = [];
578 
#6
+
 /var/www/jungsu/data/www/jung.su/protected/controllers/CategoriesController.php(198): SeriesController->getAllFrameTypeLinks("14", "79")
193                 $criteria1->order = "`name` ASC";
194                 $popgoods = new CActiveDataProvider('Goods', array('criteria' => $criteria1,'pagination' => false));
195             }
196 
197             include_once 'protected/controllers/SeriesController.php';
198             $frameTypeLinks = (new SeriesController('series'))->getAllFrameTypeLinks($brand, $series);
199 
200             
201             $this->render('series',array('popgoods'=>$popgoods,'activeurls'=>$activeurls,'urlcolordit'=>$urlcolordit,'content'=>$content,'categories'=>$categories,'colors'=>$colors,'activeframe'=>$activeframe,'activecolordigital'=>$activecolordigital,'amountframes'=>$amountframes,'frames'=>$frames,'digitals'=>$digitals,'brand'=>$brand,'series'=>$series,'userinfo'=>$userinfo,'backgrounds'=>$backgrounds,'prokrutka'=>$prokrutka,'infoforlogo'=>$infoforlogo, 'frameTypeLinks' => $frameTypeLinks));
202         }
203         else {
#21
+
 /var/www/jungsu/data/www/jung.su/index.php(61): CApplication->run()
56 // remove the following line when in production mode
57 defined('YII_DEBUG') or define('YII_DEBUG',true);
58 
59 ob_start();
60 require_once($yii);
61 Yii::createWebApplication($config)->run();
62 $res = ob_get_clean();
63 if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] !== 'XMLHttpRequest'){
64 
65     $prepareData = true;
66 
2024-03-19 14:54:40 Apache/2.4.41 (Ubuntu) Yii Framework/1.1.13