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 MySQL server version for the right syntax to use near '' at line 3. The SQL statement executed was: select * from portaleWeb_immobile
inner join portaleWeb on (porW_por_id = por_id)
where porW_imm_id =

/web/htdocs/www.eurocasachioggia.com/home/framework/yii/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

#1
+
 /web/htdocs/www.eurocasachioggia.com/home/protected/models/Site.php(129): CDbCommand->queryAll()
124     }
125     public function portaliWeb($immobile){
126         $sql = "select * from portaleWeb_immobile 
127                 inner join portaleWeb on (porW_por_id = por_id)
128                 where porW_imm_id = ".$immobile;
129         return Yii::app()->db->createCommand($sql)->queryAll();
130     }
131     public function estrazioneImgHomePage(){
132         $sql = "select * from homePage where id=1";
133         return Yii::app()->db->createCommand($sql)->queryRow();
134     }
#2
+
 /web/htdocs/www.eurocasachioggia.com/home/protected/views/site/dettaglio.php(420): Site->portaliWeb(null)
415                             
416                         </div>
417                         <div class="col-sm-12 col-lg-2 border border-success" style="text-align:justify;"><b>Social Web</b></div>
418                         <div class="col-sm-12 col-lg-10 text-right">
419                             <?php
420                             $elencoPortali = $model->portaliWeb($immobile["id"]);
421                             foreach($elencoPortali as $portale){
422                             ?>
423                                 <div class="col-sm-12 col-lg-2" style="float:right; border-bottom:1px solid #72b70f"><a href="<?php echo $portale["porW_url"];?>" target="_new"><i><?=$portale["por_nome"];?></i></a></div>
424                             <?php
425                             }
#7
+
 /web/htdocs/www.eurocasachioggia.com/home/protected/controllers/SiteController.php(183): CController->render("dettaglio", array("model" => Site, "immobile" => "2755", "titolo" => "CHIOGGIA ZONA SALONI, APPARTAMENTO CON GARAGE"))
178         $immobile = explode("-", $_GET["immobile"]);
179         $visit = explode("-", $_GET["visit"]);
180         $utente = $visit[1];
181         $gruppo = $visit[0];
182         if(strLen($utente)> 0 && strLen($gruppo) > 0) $model->salvoVisita($immobile[0], $utente, $gruppo);
183         $this->render('dettaglio', array('model'=>$model, 'immobile'=>$immobile[0], 'titolo'=>$immobile[2]));
184     
185     }
186     
187     public function actionimmobileConRiferimento()
188     {
2024-03-19 11:03:08 Apache Yii Framework/1.1.14