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 'AND rgt < ORDER BY id=1 DESC, lft ASC' at line 1. The SQL statement executed was: SELECT * FROM `cms` `t` WHERE type = 1 AND lft > AND rgt < ORDER BY id=1 DESC, lft ASC

/home/u958/dfkirov.ru/WWW/framework/yii-1.1.8/db/CDbCommand.php(516)

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

Stack Trace

#3
+
 /home/u958/dfkirov.ru/WWW/themes/main/views/modules/cms/cms/sendrequest.php(27): CActiveRecord->findAll("type = 1 AND lft > AND rgt < ")
22 ?>
23 
24 <div class="row"><br/>
25     <?php echo $form->labelEx($model, 'festival'); ?><br/>
26     <?php $fest = Cms::model()->findByPk(1739); ?>
27     <?php echo $form->dropDownList($model, 'festival', CHtml::listData(Cms::model()->findAll("type = 1 AND lft > {$fest->lft} AND rgt < {$fest->rgt}"), 'name', 'name')); ?>
28     <?php echo $form->error($model, 'festival'); ?>
29 </div>
30 
31 <div class="row"><br/>
32     <?php echo $form->labelEx($model, 'collective_name'); ?><br/>
#8
+
 /home/u958/dfkirov.ru/WWW/protected/modules/core/components/CoreController.php(69): CController->render("sendrequest", null, false)
64         }
65 
66         if($return)
67             return parent::render($view, $data, $return);
68         else
69             parent::render($view, $data, $return);
70     }
71 }
#9
+
 /home/u958/dfkirov.ru/WWW/protected/modules/cms/controllers/CmsController.php(337): CoreController->render("sendrequest")
332 
333                 $this->redirect(Yii::app()->createUrl('cms/cms/success'));
334             }
335         }
336 
337         $this->render('sendrequest');
338     }
339 
340     public function actionSendrequestcollective()
341     {
342         $this->pageTitle = 'Подать заявку на размещение коллектива';
2024-03-29 15:02:53 Apache Yii Framework/1.1.8