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 '' at line 1. The SQL statement executed was: SELECT * FROM ActorLogs WHERE actor_id =

/home/itip/web/bestactor.ru/public_html/framework/yiilite.php(9693)

9681             return $result;
9682         }
9683         catch(Exception $e)
9684         {
9685             if($this->_connection->enableProfiling)
9686                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
9687             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
9688             $message=$e->getMessage();
9689             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
9690                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
9691             if(YII_DEBUG)
9692                 $message.='. The SQL statement executed was: '.$this->getText().$par;
9693             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
9694                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
9695         }
9696     }
9697     public function buildQuery($query)
9698     {
9699         $sql=!empty($query['distinct']) ? 'SELECT DISTINCT' : 'SELECT';
9700         $sql.=' '.(!empty($query['select']) ? $query['select'] : '*');
9701         if(!empty($query['from']))
9702             $sql.="\nFROM ".$query['from'];
9703         if(!empty($query['join']))
9704             $sql.="\n".(is_array($query['join']) ? implode("\n",$query['join']) : $query['join']);
9705         if(!empty($query['where']))

Stack Trace

#1
+
 /home/itip/web/bestactor.ru/public_html/app/controllers/frontend/ActorController.php(541): CDbCommand->query()
536 
537     public function actionChart() {
538         $this->seoTitle = strtr('{fullname} график популярности. Рейтинг {gender} {fullname}', $this->seoParams);
539         $this->seoDescription = strtr('График популярности  {gender} {fullname}', $this->seoParams);
540 
541         $query = Yii::app()->db->createCommand('SELECT * FROM {{ActorLogs}} WHERE actor_id = '.$this->model->id)->query();
542         $chartsData = array();
543         $ratingMonth = array();
544         while($row = $query->read()) {
545             $unixtime = $row['created'];
546             $row['created'] = date('Y-m-d', $unixtime);
#6
+
 /home/itip/web/bestactor.ru/public_html/app/modules/rights/components/RController.php(36): CFilter->filter()
31     */
32     public function filterRights($filterChain)
33     {
34         $filter = new RightsFilter;
35         $filter->allowedActions = $this->allowedActions();
36         $filter->filter($filterChain);
37     }
38 
39     /**
40     * @return string the actions that are always allowed separated by commas.
41     */
#14
+
 /home/itip/web/bestactor.ru/public_html/app/extensions/behaviors/WebApplicationEndBehavior.php(24): CApplication->run()
19         
20 21         $this->onModuleCreate = array($this, 'changeModulePaths');
22         $this->onModuleCreate(new CEvent ($this->owner));
23         
24         $this->owner->run();        
25     }
26     
27 28     public function onModuleCreate($event)
29     {
2024-03-29 14:31:48 Apache/2.4.57 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n Yii Framework/1.1.22