CDbException

CDbCommand falló al ejecutar la sentencia SQL: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT COUNT(DISTINCT `t`.`cliente_id`) FROM `clientes` `t` LEFT OUTER JOIN `estado` `estado` ON (`t`.`estado_id`=`estado`.`estado_id`) LEFT OUTER JOIN `localizacion` `localizacion` ON (`t`.`localizacion_id`=`localizacion`.`localizacion_id`) LEFT OUTER JOIN `clientes_tipos` `clienteTipo` ON (`t`.`cliente_tipo_id`=`clienteTipo`.`cliente_tipo_id`) LEFT OUTER JOIN `paises` `pais` ON (`t`.`pais_id`=`pais`.`pais_id`) WHERE ( cliente_subtipo_id = 39 AND pais_abreviacion LIKE 'aw' AND cliente_activo = 1 )

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

#6
+
 /home/venev365/public_html/protected/views/site/viewMapa.php(11): CDataProvider->getTotalItemCount()
06 
07     $location = Paises::model()->getLocation();
08     $modelConfiguracion = Configuracion::model()->find("red_social_id = 1");
09     $config_color_barra_superior = (empty($modelConfiguracion->config_color_barra_superior)) ? "":$modelConfiguracion->config_color_barra_superior;
10     
11     if($model->getTotalItemCount() > 0) {
12     
13 ?>
14     
15     <?php 
16         
#10
+
 /home/venev365/public_html/protected/views/site/viewClientes.php(23): CController->renderPartial("viewMapa", array("model" => CActiveDataProvider))
18     
19     <div>&nbsp;</div>
20     <?php include_once '_viewEstados.php'; ?>
21 
22     <div>&nbsp;</div>
23     <?php $this->renderPartial("viewMapa",array("model"=>$model->searchClientes(array("condition"=>$condition), 500))); ?>
24     <div>&nbsp;</div>
25     
26     <div class="row">
27     
28         <?php 
#15
+
 /home/venev365/public_html/protected/controllers/SiteController.php(2197): CController->render("viewClientes", array("categoria" => "28", "condition" => " cliente_subtipo_id = 39 AND pais_abreviacion LIKE 'aw' AND c..."))
2192             // solo mostrar los clientes activos
2193             $sql .= " AND cliente_activo = 1 ";
2194             
2195             //var_dump($sql);
2196             
2197             $this->render("viewClientes",array(
2198                 "categoria"=>$categoria,
2199                 "condition"=>$sql
2200             ));
2201             
2202             die();
2024-10-13 01:28:01 Apache/2.4.62 (Unix) OpenSSL/1.1.1k Yii Framework/1.1.16