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 'T-TELL-MOVIE-(1993)-PETER-STRAUSS') ORDER BY create_time DESC' at line 1. The SQL statement executed was: SELECT id, title, price, opt_price, area, photos FROM `annonce` `t` WHERE (homepage = 1 AND public = 1) AND (area = 'a,1179,MEN-DON'T-TELL-MOVIE-(1993)-PETER-STRAUSS') ORDER BY create_time DESC

/home/livesimo/public_html/yii-1.1.7.r3135/framework/db/CDbCommand.php(518)

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

Stack Trace

#3
+
 /home/livesimo/public_html/protected/components/HomePageAdsGallery.php(15): CActiveRecord->findAll(CDbCriteria)
10         $criteria->select = array('id','title','price','opt_price','area','photos');
11         $criteria->condition = "homepage = 1 AND public = 1";
12         if ($this->selectedLocation!='')
13             $criteria->addCondition("area = '{$this->selectedLocation}'");
14         $criteria->order = "create_time DESC";
15         $ads = Annonce::model()->findAll($criteria);
16         $this->render('HomePageAdsGallery',array('ads'=>$ads));    
17     }
18 }
#5
+
 /home/livesimo/public_html/themes/classified/views/site/home.php(6): CBaseController->widget("HomePageAdsGallery", array("selectedLocation" => "a,1179,MEN-DON'T-TELL-MOVIE-(1993)-PETER-STRAUSS"))
01 <?php
02 include_once(Yii::getPathOfAlias("webroot").'/protected/modules/Core/extensions/web/helpers/FlexImage.php');
03 include_once(Yii::getPathOfAlias("webroot").'/protected/modules/Core/extensions/web/helpers/string.php');
04 ?>
05 
06 <?php $this->widget('HomePageAdsGallery',array('selectedLocation'=>$this->get('location',''))); ?>
07 <div class="main-content">
08     <?php $this->widget('AdsCategoryList',array('selectedLocation'=>$this->get('location',''))); ?>
09     <div class="facebook">
10         <fb:like href="<?php echo baseUrl(); ?>" send="false" width="450" show_faces="false"></fb:like>
11     </div>     
#8
+
 /home/livesimo/public_html/protected/modules/Core/extensions/web/FController.php(101): CBaseController->renderFile("/home/livesimo/public_html/themes/classified/views/site/home.php", null, true)
096     
097     public function renderFile($viewFile,$data=null,$return=false)
098     {
099         //Track the current view file so the InlineViewWidget knows which view it belong to
100         $this->CurrentViewFile = $viewFile;
101         return parent::renderFile($viewFile, $data, $return);
102     }    
103 
104     /**
105     * Get message of current page and also previous page
106     * 
2012-05-25 00:10:53 Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Yii Framework/1.1.7