CDbException

CDbCommand failed to prepare the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'nick22_db.t.slug' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

/home/nick22/public_html/yii/framework/db/CDbCommand.php(218)

206     {
207         if($this->_statement==null)
208         {
209             try
210             {
211                 $this->_statement=$this->getConnection()->getPdoInstance()->prepare($this->getText());
212                 $this->_paramLog=array();
213             }
214             catch(Exception $e)
215             {
216                 Yii::log('Error in preparing SQL: '.$this->getText(),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
217                 $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
218                 throw new CDbException(Yii::t('yii','CDbCommand failed to prepare the SQL statement: {error}',
219                     array('{error}'=>$e->getMessage())),(int)$e->getCode(),$errorInfo);
220             }
221         }
222     }
223 
224     /**
225      * Cancels the execution of the SQL statement.
226      */
227     public function cancel()
228     {
229         $this->_statement=null;
230     }

Stack Trace

#5
+
 /home/nick22/public_html/protected/modules/blog/models/Terms.php(230): CActiveRecord->findAll(CDbCriteria)
225                            left join ((select wp_term_taxonomy.term_id  from wp_term_taxonomy ) as c) on (c.term_id = wp_term_taxonomy.parent)';
226                 $crit->condition = 'wp_term_taxonomy.taxonomy = "category" and parent = :parentid';
227                 $crit->params = array(':parentid' => "$id");
228                 $crit->order = 'name asc';
229                 $crit->group = 'name';
230             $posts = $this->findAll($crit);
231             
232                 
233                 return $posts;
234                 
235         
#6
+
 /home/nick22/public_html/protected/modules/blog/components/BlogComponent.php(58): Terms->getCategoriesByParentId("0")
53     }
54     
55     public function getChildrenModels($id = 0) {
56         
57         $tmp = array();
58         $cats = Terms::model()->getCategoriesByParentId($id);
59         return $cats;
60     }
61     
62     public function getLatestPosts($count = 5) 
63     {
#7
+
 /home/nick22/public_html/protected/modules/blog/components/BlogComponent.php(85): BlogComponent->getChildrenModels("0")
80         
81     }
82     
83     public function getSidebar($root = 0) {
84         
85         $children = $this->getChildrenModels($root); 
86         $tmp = '<div id="blog-categories" class="side-block"><div class="title">Blog Categories</div><div class="side-content">';
87 
88          
89          
90         
2024-03-19 03:40:08 Apache Yii Framework/1.1.9