CDbException

CDbCommand ล้มเหลวในการดำเนินการเรียกลักษณะของ SQL: 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 'ORDER BY `t`.`lastname` LIMIT 1' at line 1. The SQL statement executed was: SELECT * FROM `bachelor65` `t` WHERE studentID LIKE :studentID OR (name LIKE :name OR lastname LIKE :lastname) ORDER BY id DESC ORDER BY `t`.`lastname` LIMIT 1

E:\etc\www\regis\CheckStudentCard\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

#7
+
 E:\etc\www\regis\CheckStudentCard\protected\extensions\bootstrap\widgets\TbGridView.php(68): CGridView->init()
63      *
64      * Initializes the widget.
65      */
66     public function init()
67     {
68         parent::init();
69 
70         $classes = array('table');
71         if (isset($this->type)) {
72             if (is_string($this->type)) {
73                 $this->type = explode(' ', $this->type);
#10
+
 E:\etc\www\regis\CheckStudentCard\protected\views\bachelor\show65.php(103): CBaseController->widget()
098           //'htmlOptions' => array('style' => 'width: 100px'),
099         ), 
100     ),
101     'emptyText' => '<b><span style=color:red>***นักศึกษายังไม่ได้ค้นหาข้อมูล หรือ ยังไม่มีข้อมูลของนักศึกษาในการรับบัตร กรุณารอ อัพเดท ข้อมูลบัตรในรอบถัดไป...***</span></b>',
102     'summaryText' => '<center><b><span style=color:red>***เมื่อนักศึกษาตรวจสอบรายชื่อแล้ว ให้ดำเนินตามวิธีที่แนบมาด้านบน***</span></b></center>',
103     ));
104 ?>
#15
+
 E:\etc\www\regis\CheckStudentCard\protected\controllers\BachelorController.php(160): CController->render("/Bachelor/Show65", array("model" => Bachelor65))
155         if (isset($_GET['Bachelor65']))
156             $model->attributes = $_GET['Bachelor65'];
157 
158         $this->render('/Bachelor/Show65', array(
159             'model' => $model,
160         ));
161     }
162     /**
163      * Returns the data model based on the primary key given in the GET variable.
164      * If the data model is not found, an HTTP exception will be raised.
165      * @param integer the ID of the model to be loaded
2024-03-29 19:46:14 Apache/2.2.8 (Win32) PHP/5.3.28 Yii Framework/1.1.14