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 MariaDB server version for the right syntax to use near '' union select 1,2,3,4,5,6,7-- -) AND (con_status = 1))' at line 1. The SQL statement executed was: SELECT `t`.`con_id` AS `t0_c0`, `t`.`con_slug` AS `t0_c1`, `t`.`con_status` AS `t0_c2`, `t`.`con_gallery` AS `t0_c3`, `t`.`con_previd` AS `t0_c4`, `t`.`con_hascomments` AS `t0_c5`, `t`.`con_categoryid` AS `t0_c6`, `t`.`con_tags` AS `t0_c7`, `t`.`con_parentid` AS `t0_c8`, `t`.`date_id` AS `t0_c9`, `content_lang`.`lng_id` AS `t1_c0`, `content_lang`.`lng_contentid` AS `t1_c1`, `content_lang`.`lng_languageid` AS `t1_c2`, `content_lang`.`lng_title` AS `t1_c3`, `content_lang`.`lng_excerpt` AS `t1_c4`, `content_lang`.`lng_text` AS `t1_c5` FROM `mme_cms_contents` `t` LEFT OUTER JOIN `mme_cms_content_langs` `content_lang` ON (`content_lang`.`lng_contentid`=`t`.`con_id`) AND (lng_languageid = "1") WHERE ((con_id = -29' union select 1,2,3,4,5,6,7-- -) AND (con_status = 1))

/home/mmelb/public_html/web/yii/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

#6
+
 /home/mmelb/public_html/web/protected/controllers/CmsController.php(10): CActiveRecord->find(CDbCriteria)
05         if(Jii::param('id')){
06             $criteria = new CDbCriteria;
07             $criteria->addCondition('con_id = '.Jii::param('id'));
08             $criteria->addCondition('con_status = '.Content::status()->getItem('publish')->getValue());
09             $criteria->with = array('content_lang:'.Jii::app()->language,'comment'=>array('condition'=>'com_status = '.Comment::status()->getItem('approved')->getValue()));
10             $view = Content::model()->find($criteria);
11             if(isset($view->con_id)){
12                 $this->render('view',array('view'=>$view));
13             }else{
14                 $this->redirect(Jii::app()->baseUrl);
15             }
#14
+
 /home/mmelb/public_html/web/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
16 ob_flush();
2020-06-21 08:26:46 Apache Yii Framework/1.1.10