CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'tags' in where clause is ambiguous. The SQL statement executed was: SELECT COUNT(*) FROM `w3d_Content` `t` JOIN `w3d_ContentTranslate` `tt` ON `t`.`id` = `tt`.`oId` WHERE ((tags LIKE :ycp0) AND (published = 1)) AND (langCode = 'en')

/home/kvnw3d/yii/framework/db/CDbCommand.php(541)

529         {
530             if($this->_connection->enableProfiling)
531                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
532 
533             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
534             $message=$e->getMessage();
535             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
536                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
537 
538             if(YII_DEBUG)
539                 $message.='. The SQL statement executed was: '.$this->getText().$par;
540 
541             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
542                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
543         }
544     }
545 
546     /**
547      * Builds a SQL SELECT statement from the given query specification.
548      * @param array $query the query specification in name-value pairs. The following
549      * query options are supported: {@link select}, {@link distinct}, {@link from},
550      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
551      * {@link limit}, {@link offset} and {@link union}.
552      * @return string the SQL statement
553      * @since 1.1.6

Stack Trace

#2
+
 /home/kvnw3d/protected/components/ActiveRecord.php(200): CActiveRecord->count(CDbCriteria)
195     }
196     public function count($condition='',$params=array()){
197         $builder=$this->getCommandBuilder();
198         $criteria=$builder->createCriteria($condition,$params);
199         $criteria = ModelHelper::addTranslateTable($criteria, get_class($this));
200         return parent::count($criteria);
201     }
202     
203     public function __get($name) {
204         if(($pos = strpos($name,'[')) !== false){
205             $att = substr($name, 0, $pos);
#11
+
 /home/kvnw3d/protected/modules/article/views/content/search.php(41): CBaseController->widget("zii.widgets.CListView", array("dataProvider" => CActiveDataProvider, "itemView" => "_view", "template" => "{items} {pager}"))
36 
37 <?php $this->widget('zii.widgets.CListView', array(
38     'dataProvider'=>$dp,
39     'itemView'=>'_view',
40     'template'=>"{items}\n{pager}",
41 ));
42 }
43 ?>
44 </div></div></div>
45     <!-- end middle -->
46 
#15
+
 /home/kvnw3d/protected/components/Controller.php(207): CController->renderPartial("search", array("dp" => CActiveDataProvider), true)
202         return $this->createUrl($route, $params);
203     }
204 
205     public function render($view, $data = null, $return = false) {
206         if ($this->beforeRender($view)) {
207             $output = $this->renderPartial($view, $data, true);
208             if (($layoutFile = $this->getLayoutFile($this->getLayout())) !== false)
209                 $output = $this->renderFile($layoutFile, array('content' => $output), true);
210 //                        echo $layoutFile;
211             header("Access-Control-Allow-Origin: *");
212             header("Access-Control-Allow-Methods: GET, OPTIONS, POST, PUT, DELETE");
2024-03-19 11:22:26 Apache Yii Framework/1.1.13