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 1. The SQL statement executed was: SELECT * FROM tbl_user_images WHERE user_id=

/var/www/vhosts/apnikheti.com/httpdocs/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

#1
+
 /var/www/vhosts/apnikheti.com/httpdocs/protected/components/commionFunction.php(1213): CDbCommand->queryAll()
1208 
1209     public function getExpertAllImg($user_id)
1210     {
1211         $sql = "SELECT * FROM tbl_user_images WHERE user_id=".$user_id;
1212         $rawData = Yii::app()->db2->createCommand($sql);
1213         return $categoryData = $rawData->queryAll();
1214     }
1215 
1216 
1217     public function getAllQuestionsAnswerNew($question_id,$limit,$user_type=0)
1218     {
#2
+
 /var/www/vhosts/apnikheti.com/httpdocs/protected/views/site/expert_profile_demo.php(8): MyClass->getExpertAllImg(null)
03 $language = New Languages($langu);
04 $langArray = array();
05 $langArray =  $language->userLanguage();  
06 $base_path=Yii::app()->request->baseUrl; 
07 $myClass = New MyClass();
08 $images = $myClass->getExpertAllImg($users->id);
09 $userImg = $myClass->getExpertImg($users->id);
10 $state_id = $users->state_id;
11 $stateName = $myClass->getStateName($state_id,$langu);
12 $expertBadge="expert_badge_$langu";
13 $badge=$users->$expertBadge;
#7
+
 /var/www/vhosts/apnikheti.com/httpdocs/protected/controllers/SiteController.php(7718): CController->render("expert_profile_demo", array("users" => null))
7713             $update = $myClass->updateNotificationCountById($id,$user_id);
7714         }
7715         
7716 
7717         $users = Users::model()->findByPk($id);
7718         $this->render('expert_profile_demo',array('users'=>$users));
7719     }
7720     
7721     
7722     public function actionUserProfileDetails($slug)
7723     {
2024-04-18 21:31:42 Apache Yii Framework/1.1.19