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 MariaDB server version for the right syntax to use near ')) AND (is_premium=1)) LIMIT 22' at line 1. The SQL statement executed was: SELECT `t`.`id` AS `t0_c0`, `t`.`title` AS `t0_c1`, `t`.`content` AS `t0_c2`, `t`.`sortorder` AS `t0_c3`, `t`.`slug` AS `t0_c4`, `t`.`type` AS `t0_c5`, `t`.`hits` AS `t0_c6`, `t`.`datetime` AS `t0_c7`, `t`.`meta_title` AS `t0_c8`, `t`.`meta_description` AS `t0_c9`, `t`.`meta_keywords` AS `t0_c10`, `t`.`doi_url` AS `t0_c11`, `t`.`publisher_id` AS `t0_c12`, `t`.`school_id` AS `t0_c13`, `t`.`textbook_id` AS `t0_c14`, `t`.`vnz_id` AS `t0_c15`, `t`.`published_date` AS `t0_c16`, `t`.`quote` AS `t0_c17`, `t`.`is_premium` AS `t0_c18`, `t`.`rating` AS `t0_c19` FROM `vs_library_material` `t` WHERE ((t.id IN (SELECT material_id FROM vs_library_relation_type WHERE type_id=)) AND (is_premium=1)) LIMIT 22

/var/www/opHFcF/op.ua/framework/db/CDbCommand.php(543)

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

Stack Trace

#6
+
 /var/www/opHFcF/op.ua/protected/modules/library/controllers/FrontController.php(268): CActiveRecord->findAll(CDbCriteria)
263             $criteria->offset = $_POST['offset'];
264         }
265 
266         $criteriaPremium = clone $criteria;
267         $criteriaPremium->addCondition("is_premium=1");
268         $premiums = LibraryMaterial::model()->findAll($criteriaPremium);
269         $criteria->addCondition("is_premium=0");
270 
271 
272         if($sort == 'rating_desc'){
273             $criteria->order = 't.rating DESC';
#16
+
 /var/www/opHFcF/op.ua/protected/behaviors/WebApplicationEndBehavior.php(25): CApplication->run()
20      
21      // ������������ ������� �������� ������
22      $this->onModuleCreate = array($this, 'changeModulePaths');
23      $this->onModuleCreate(new CEvent ($this->owner));
24      
25      $this->owner->run();
26      
27      
28      }
29      
30      // ���������� ������� onModuleCreate
#18
+
 /var/www/opHFcF/op.ua/index.php(30): CComponent->__call("runEnd", array("frontend"))
25 
26 $yii = dirname(__FILE__) . '/framework/yii.php';
27 $config = dirname(__FILE__) . '/protected/config/frontend.php';
28 
29 require_once($yii);
30 Yii::createWebApplication($config)->runEnd('frontend');
2024-03-28 14:44:50 Apache Yii Framework/1.1.22-dev