CDbException

CDbCommand falló al ejecutar la sentencia SQL: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'clasificacion' in where clause is ambiguous. The SQL statement executed was: SELECT `t`.`id`, `t`.`nombre`, `t`.`fecha`, `t`.`clasificacion`, `t`.`descripcion`, `t`.`descripcion2`, `t`.`bibliografia`, `t`.`autor`, `t`.`vease`, `t`.`redireccion`, `t`.`last_update`, `t`.`parent`, `t`.`clone`, `t`.`publish` FROM `voces` `t` LEFT JOIN voces as voz_clone ON t.clone = voz_clone.id WHERE ((t.nombre LIKE 'a%' AND clasificacion = '2' ) AND (t.clone IS NULL OR voz_clone.publish = false)) AND (t.publish = true) ORDER BY nombre ASC

/srv/users/institutoroche/apps/enciclopediabioderecho/yii-1.1.24/framework/db/CDbCommand.php(543)

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

Stack Trace

#3
+
 /srv/users/institutoroche/apps/enciclopediabioderecho/app/protected/controllers/VocesController.php(77): CActiveRecord->findAll(CDbCriteria)
72         $criteria->join = 'LEFT JOIN voces as voz_clone ON t.clone = voz_clone.id';
73         $criteria->addCondition("t.clone IS NULL OR voz_clone.publish = false");
74         $criteria->addCondition("t.publish = true");
75         
76         $criteria->order = "nombre ASC";
77         $Content=Voces::model()->findAll($criteria);
78 
79         $this->render('index',array('Content'=>$Content , 'array_letras'=>$this->array_letras, 'letraactual'=>$letra, 'clasificacion' => $clasificacion,  ));
80     }
81 
82 /////////////////////////////////////////////////////////////////////////////////////////
#11
+
 /srv/users/institutoroche/apps/enciclopediabioderecho/app/index.php(15): CApplication->run()
10 
11     defined('YII_DEBUG') or define('YII_DEBUG',$environment->getDebug());
12     defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', $environment->getTraceLevel());
13 
14     require_once($yii);
15     Yii::createWebApplication($environment->getConfig())->run();
2024-03-29 11:21:28 Apache/2.4.58 (Unix) OpenSSL/1.0.2g Yii Framework/1.1.24