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 '1084095 AND begin_time <= 1710806400 AND end_time > 1710806400 LIMIT 1' at line 1. The SQL statement executed was: SELECT * FROM `nt_advertise_attach` `t` WHERE aid = 125 AND ad_status = 1 AND product_id = 1084080,1084095 AND begin_time <= 1710806400 AND end_time > 1710806400 LIMIT 1

/srv/http/btrworlds.com/yii/framework/db/CDbCommand.php(488)

476             if (isset($cache, $cacheKey))
477                 $cache->set($cacheKey, $result, $this->_connection->queryCachingDuration, $this->_connection->queryCachingDependency);
478 
479             return $result;
480         } catch (Exception $e) {
481             if ($this->_connection->enableProfiling)
482                 Yii::endProfile('system.db.CDbCommand.query(' . $this->getText() . $par . ')', 'system.db.CDbCommand.query');
483             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
484             $message = $e->getMessage();
485             Yii::log(Yii::t('yii', 'CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.', array('{method}' => $method, '{error}' => $message, '{sql}' => $this->getText() . $par)), CLogger::LEVEL_ERROR, 'system.db.CDbCommand');
486             if (YII_DEBUG)
487                 $message .= '. The SQL statement executed was: ' . $this->getText() . $par;
488             throw new CDbException(Yii::t('yii', 'CDbCommand failed to execute the SQL statement: {error}', array('{error}' => $message)), (int) $e->getCode(), $errorInfo);
489         }
490     }
491 
492     /**
493      * Builds a SQL SELECT statement from the given query specification.
494      * @param array $query the query specification in name-value pairs. The following
495      * query options are supported: {@link select}, {@link distinct}, {@link from},
496      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
497      * {@link limit}, {@link offset} and {@link union}.
498      * @return string the SQL statement
499      * @since 1.1.6
500      */

Stack Trace

#3
+
 /srv/http/btrworlds.com/htdocs/protected/components/LibCommon.php(1638): CActiveRecord->find("aid = 125 AND ad_status = 1 AND product_id = 1084080,1084095 AND...")
1633             $criteria->condition = "keyword = '{$tag}'";
1634             $adList = AdvertiseKeyword::model()->find($criteria);
1635             //获取tag页面广告位第一名,type:string;
1636             if (!empty($adList)) {
1637                 if (isset($adList->prestige) && $adList->prestige != '') {
1638                     $advDetail = AdvertiseAttach::model()->find("aid = {$adList->aid} AND ad_status = 1 AND product_id = {$adList->prestige} AND begin_time <= {$nowTime} AND end_time > {$nowTime}");
1639                     if (!empty($advDetail))
1640                         $tagAd_list[] = $advDetail;
1641                 }
1642                 //获取tag页面广告位第2-10名,type:array();
1643                 if (isset($adList->advanced) && $adList->advanced != '') {
#4
+
 /srv/http/btrworlds.com/htdocs/protected/controllers/ProductsController.php(1123): LibCommon::getTagAdv("traction machine")
1118             }
1119         }
1120 
1121         if (!empty($word)) {
1122             $adv_product = array();
1123             $adv_list = LibCommon::getTagAdv($word);
1124             if (!empty($adv_list) && $adv_list != false) {
1125                 foreach ($adv_list as $k => $v) {
1126                     $proCriteria = new CDbCriteria();
1127                     $proCriteria->select = 'title,tempdate,description,unit_price_payment,groupid,min_order,delivery_time,keywords';
1128                     $proCriteria->condition = "id = {$v->product_id}";
#13
+
 /srv/http/btrworlds.com/htdocs/index.php(17): CApplication->run()
12 // specify how many levels of call stack should be shown in each log message
13 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 0); 
14 
15 require_once($yii);
16 
17 Yii::createWebApplication($config)->run();
2024-03-19 04:36:38 nginx/1.4.7 Yii Framework/1.1.12