CDbException

CDbCommand failed to execute the SQL statement: 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 `lx_categories` `t` WHERE parent_id=

C:\inetpub\wwwroot\ndda\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

#3
+
 C:\inetpub\wwwroot\ndda\protected\models\Categories.php(364): CActiveRecord->findAll(array("condition" => "parent_id="))
359         $criteria->compare('sefname', $sefname);
360         $criteria->compare('lang_id', Controller::getLangId());
361         $criteria->compare('active', '1');
362         $criteria->order = 'position ASC, root, lft';
363         $category = Categories::model()->findAll($criteria);
364         return Categories::model()->findAll(['condition'=>'parent_id='.$category[0]->id]);
365     }
366 
367     public function getLink($item){
368         if($item=="lek_sred"){
369             $item = "/mainpage/ls";
#4
+
 C:\inetpub\wwwroot\ndda\themes\dari\views\mainpage\indexLs.php(17): Categories->getMenuBySefName("lek_sred")
12                                  Лекарственное средство – средство, представляющее собой или содержащее вещество либо комбинацию веществ, вступающее в контакт с организмом человека, предназначенное для лечения, профилактики заболеваний человека или восстановления, коррекции или изменения его физиологических функций посредством фармакологического, иммунологического либо метаболического воздействия, или для диагностики заболеваний и состояния человека
13                         </div>
14                     </div>
15                     <div class="col-md-12 mb-15" style="border: 1px solid #f0f0f0;">
16                         <div class="row">
17                         <?$menus = Categories::getMenuBySefName("lek_sred");?>
18                         <?php foreach ($menus as $key => $menu): ?>
19                             <div class="col-md-3 mt-15" >
20                                 <div>
21                                     <hr class="solid" style="border-top: 3px solid #dfdfdf;">
22                                     <a href="/category/<?=$menu->sefname?>">
#9
+
 C:\inetpub\wwwroot\ndda\protected\controllers\MainpageController.php(31): CController->render("indexLs", array("mainpage" => Pages, "parners" => array(Partners, Partners, Partners, Partners, ...)))
26         $this->layout = 'mainPage';
27         $this->isMainpage = true;
28         $mainpage = Pages::model()->getOnePageInCategory('mainpage');
29         $parners = Partners::model()->findAll(['condition'=>'active=1']);
30 
31         $this->render('indexLs', array('mainpage' => $mainpage,'parners'=>$parners));
32     }
33 
34     public function actionMi() {
35         $this->layout = 'mainPage';
36         $this->isMainpage = true;
2024-03-29 00:35:14 Microsoft-IIS/10.0 Yii Framework/1.1.12