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 'LIMIT 1' at line 1. The SQL statement executed was: SELECT AVG(rating) as totRating FROM `florida_keys_rating_tbl` `t` WHERE placeId= LIMIT 1

/home/visitfloridakeys/public_html/yii/framework/db/CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#3
+
 /home/visitfloridakeys/public_html/protected/models/FloridaPlceRating.php(84): CActiveRecord->find(CDbCriteria)
79         
80         $q->select = "AVG(rating) as totRating";
81         
82         $q->condition = "placeId=" . $videoid . " ";
83         
84         $result = $this->model()->find($q);
85         
86         return round($result['totRating'],2);
87         //return $result['totRating'];
88     }
89 
#4
+
 /home/visitfloridakeys/public_html/protected/views/site/viewproperty.php(117): FloridaPlceRating->total_rating(null)
112       
113       <div class="company-preamble-content">
114                 <h1 class="listing-head"><a href="#"><?php echo $prodetail['adTitle'];?></a>  </h1>
115                 <span class="listing-star">
116                 <?php
117                  $vratingindex=FloridaPlceRating::model()->total_rating($prodetail['id']);
118                 ?>
119                 <?php if($vratingindex >='1') { ?>
120 <div class="rating_box"><div class="star_rating_inactive"></div><div class="star_rating_active" title="Rating - <?php echo $vratingindex;?> out of 5" style="width:<?php echo $vratingindex*20; ?>%"></div></div>
121                 <?php } ?>
122             
#9
+
 /home/visitfloridakeys/public_html/protected/controllers/SiteController.php(1082): CController->render("viewproperty", array("prodetail" => null, "proimages" => array(), "message" => "", "messagemesg" => "", ...))
1077         
1078           $catdetail=Procategory::model()->findByAttributes(array('id'=>$prodetail['catId']));
1079         $subcatdata= Prosubcategory::model()->findByAttributes(array('id'=>$prodetail['subcatId']));
1080         
1081         
1082       $this->render('viewproperty',array('prodetail'=>$prodetail,'proimages'=>$proimages,'message'=>$message,'messagemesg'=>$messagemesg,'commewntmesg'=>$commewntmesg,'commentonId'=>$commentonId,'catdetail'=>$catdetail,'subcatdata'=>$subcatdata));       
1083      
1084     }
1085     
1086     
1087     public function actionLogout()
2024-03-19 03:54:02 Apache Yii Framework/1.1.11