Welcome秒速时时彩开奖为梦而年轻!

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 'and status=1 ORDER BY sort_order desc LIMIT 40' at line 1. The SQL statement executed was: SELECT * FROM `dhh_columncate` `t` WHERE pid= and status=1 ORDER BY sort_order desc LIMIT 40

D:\1\873940\wwwroot\framework\db\CDbCommand.php(541)

529         {
530             if($this->_connection->enableProfiling)
531                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
532 
533             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
534             $message=$e->getMessage();
535             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
536                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
537 
538             if(YII_DEBUG)
539                 $message.='. The SQL statement executed was: '.$this->getText().$par;
540 
541             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
542                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
543         }
544     }
545 
546     /**
547      * Builds a SQL SELECT statement from the given query specification.
548      * @param array $query the query specification in name-value pairs. The following
549      * query options are supported: {@link select}, {@link distinct}, {@link from},
550      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
551      * {@link limit}, {@link offset} and {@link union}.
552      * @return string the SQL statement
553      * @since 1.1.6

Stack Trace

#3
+
 D:\1\873940\wwwroot\protected\controllers\ListController.php(47): CActiveRecord->findAll(CDbCriteria)
42 
43         $criteria=new CDbCriteria;
44         $criteria->limit=40;
45         $criteria->order="sort_order desc";
46         $criteria->condition="pid=".$pcole->id." and status=1";
47         $subcol=columncate::model()->findAll($criteria);
48         $sub=array();
49         foreach($subcol as $n=>$vo) {
50             $criteria->limit = 40;
51             $criteria->order = "sort_order ";
52             $criteria->condition = "pid=" . $vo->id . " and status=1";
#11
+
 D:\1\873940\wwwroot\index.php(15): CApplication->run()
10 $yii=dirname(__FILE__).'/framework/yii.php';
11 $config=dirname(__FILE__).'/protected/config/main.php';
12 defined('YII_DEBUG') or define('YII_DEBUG',true);
13 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
16 
17 ?>
2019-08-14 20:59:03 Microsoft-IIS/7.5 /1.1.13