CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT `t`.`id` AS `t0_c0`, `t`.`type` AS `t0_c1`, `t`.`pagetitle` AS `t0_c2`, `t`.`longtitle` AS `t0_c3`, `t`.`description` AS `t0_c4`, `t`.`alias` AS `t0_c5`, `t`.`link_attributes` AS `t0_c6`, `t`.`published` AS `t0_c7`, `t`.`pub_date` AS `t0_c8`, `t`.`unpub_date` AS `t0_c9`, `t`.`parent` AS `t0_c10`, `t`.`isfolder` AS `t0_c11`, `t`.`introtext` AS `t0_c12`, `t`.`content` AS `t0_c13`, `t`.`richtext` AS `t0_c14`, `t`.`template` AS `t0_c15`, `t`.`menuindex` AS `t0_c16`, `t`.`searchable` AS `t0_c17`, `t`.`cacheable` AS `t0_c18`, `t`.`createdby` AS `t0_c19`, `t`.`createdon` AS `t0_c20`, `t`.`editedby` AS `t0_c21`, `t`.`editedon` AS `t0_c22`, `t`.`deleted` AS `t0_c23`, `t`.`deletedon` AS `t0_c24`, `t`.`deletedby` AS `t0_c25`, `t`.`publishedon` AS `t0_c26`, `t`.`publishedby` AS `t0_c27`, `t`.`menutitle` AS `t0_c28`, `t`.`donthit` AS `t0_c29`, `t`.`privateweb` AS `t0_c30`, `t`.`privatemgr` AS `t0_c31`, `t`.`content_dispo` AS `t0_c32`, `t`.`hidemenu` AS `t0_c33`, `t`.`class_key` AS `t0_c34`, `t`.`context_key` AS `t0_c35`, `t`.`content_type` AS `t0_c36`, `t`.`uri` AS `t0_c37`, `t`.`uri_override` AS `t0_c38`, `t`.`hide_children_in_tree` AS `t0_c39`, `t`.`show_in_tree` AS `t0_c40`, `t`.`properties` AS `t0_c41`, `t`.`alias_visible` AS `t0_c42`, `pImage`.`id` AS `t1_c0`, `pImage`.`tmplvarid` AS `t1_c1`, `pImage`.`contentid` AS `t1_c2`, `pImage`.`value` AS `t1_c3` FROM `modx_site_content` `t` left join `modx_site_tmplvar_contentvalues` `pImage` ON (`pImage`.`contentid`=`t`.`id`) WHERE (`parent` = 0 AND `published` = 1 AND `hidemenu` = 0)

/var/www/imrsosh8/data/www/yii-1.1.17.467ff50/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/imrsosh8/data/www/imr-sosh8.ru/sv/protected/views/layouts/_leftmenu.php(2): CActiveRecord->findAll("`parent` = 0 AND `published` = 1 AND `hidemenu` = 0", array("order" => "menuindex"))
1 <?php
2 $items = ModxSiteContent::model()->findAll('`parent` = 0 AND `published` = 1 AND `hidemenu` = 0',array('order'=>'menuindex'));
3 
4 ?>
5 
6 <ul class="menu">
7     <?php
#10
+
 /var/www/imrsosh8/data/www/imr-sosh8.ru/sv/protected/views/layouts/main.php(27): CController->renderPartial("//layouts/_leftmenu")
22             </dl>
23         </div>
24         <div class="container">
25             <?php $this->renderPartial('//layouts/_header'); ?>
26             <div class="left-sidebar">
27                 <?php $this->renderPartial('//layouts/_leftmenu'); ?>
28             </div>
29             <div class="center-sidebar">
30                 <div class="content">
31                     <?php echo $content; ?>
32                 </div>
#14
+
 /var/www/imrsosh8/data/www/imr-sosh8.ru/sv/protected/controllers/ViewController.php(33): CController->render("index", array("model" => ModxSiteContent, "childs" => array(ModxSiteContent, ModxSiteContent, ModxSiteContent, ModxSiteContent, ...)))
28         if($model->id == 45){
29             $model->content = RNDR::getFos();
30         }
31         
32         
33         $this->render('index',array('model'=>$model,'childs'=>$childs));
34     }
35 }
2024-03-28 14:21:22 Apache/2.4.38 (Debian) Yii Framework/1.1.17