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 eq.question_title,question_title_pb,question_title_hn,eq.id as qaid,eq.created_date,eq.query_form_id,eq.user_id FROM `tbl_experts_question` as eq,tbl_experts_question_assign as eqa WHERE eq.id=eqa.question_id AND eq.status=1 AND eq.`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(1344): CDbCommand->queryRow()
1339     {
1340         $sql = "SELECT eq.question_title,question_title_pb,question_title_hn,eq.id as qaid,eq.created_date,eq.query_form_id,eq.user_id FROM `tbl_experts_question` as eq,tbl_experts_question_assign as eqa WHERE eq.id=eqa.question_id AND eq.status=1  AND eq.`id`=".$question_id;
1341         
1342         
1343         $rawData = Yii::app()->db2->createCommand($sql);
1344         return $categoryData = $rawData->queryRow();
1345     }
1346 
1347     public function getExpertDetails($user_id)
1348     {
1349         $sql = "SELECT device_token,id,state_id,district_id,tehsil_id,village_id,name,slugs,user_type,phone,expert_badge_en,expert_badge_hn,expert_badge_pb FROM `tbl_users` WHERE `id`=".$user_id;
#2
+
 /var/www/vhosts/apnikheti.com/httpdocs/protected/views/site/expertQADetailsDemo.php(34): MyClass->getSingleQuestions(null)
29 
30 
31 
32 }
33 
34 $question = $myClass->getSingleQuestions($id);
35 
36 
37 $user_id = Yii::app()->user->getState('id'); 
38 $ctr = 0;
39 $limit = 50;     
#7
+
 /var/www/vhosts/apnikheti.com/httpdocs/protected/controllers/SiteController.php(7655): CController->render("expertQADetailsDemo", array("model" => ExpertAnswer))
7650                     }
7651                  }
7652             }
7653             
7654             
7655             $this->render('expertQADetailsDemo', array('model' => $model));
7656         }
7657         else
7658         {     $model=new ExpertAnswer;
7659              $this->redirect(array('site/ExpertQA'));
7660         }
2024-03-28 19:41:07 Apache Yii Framework/1.1.19