[10501] PDOException in Connection.php line 390

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 ( a.goods_type between 0 and 2 ) AND ( 1=1 and a.is_on = 1 and a.expir' at line 1

  1. $this->PDOStatement->execute();
  2. // 调试结束
  3. $this->debug(false, '', $master);
  4. // 返回结果集
  5. return $this->getResult($pdo, $procedure);
  6. } catch (\PDOException $e) {
  7. if ($this->isBreak($e)) {
  8. return $this->close()->query($sql, $bind, $master, $pdo);
  9. }
  10. throw new PDOException($e, $this->config, $this->getLastsql());
  11. } catch (\Throwable $e) {
  12. if ($this->isBreak($e)) {
  13. return $this->close()->query($sql, $bind, $master, $pdo);
  14. }
  15. throw $e;
  16. } catch (\Exception $e) {
  17. if ($this->isBreak($e)) {
  18. return $this->close()->query($sql, $bind, $master, $pdo);
  19. }

Call Stack

  1. in Connection.php line 390
  2. at Connection->query('SELECT `a`.*,`b`.`co...', [], false, false) in Query.php line 248
  3. at Query->query('SELECT `a`.*,`b`.`co...', [], false, false) in Query.php line 2476
  4. at Query->select() in Goods.php line 87
  5. at Goods->getRecommend(null) in Pcms.php line 292
  6. at Pcms->items('/index.php', object(Update), '5') in Update.php line 90
  7. at Update->analyzeUrl() in Update.php line 57
  8. at Update->index()
  9. at ReflectionMethod->invokeArgs(object(Update), []) in App.php line 343
  10. at App::invokeMethod([object(Update), 'index'], []) in App.php line 606
  11. at App::module(['upgrade', 'update', null], ['app_host' => '', 'app_debug' => '1', 'app_trace' => '', ...], true) in App.php line 456
  12. at App::exec(['type' => 'module', 'module' => ['upgrade', 'update', null]], ['app_host' => '', 'app_debug' => '1', 'app_trace' => '', ...]) in App.php line 139
  13. at App::run() in start.php line 19
  14. at require('/www/wwwroot/zuanqun...') in index.php line 26

Exception Datas

PDO Error Info
SQLSTATE 42000
Driver Error Code 1064
Driver Error Message 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 ( a.goods_type between 0 and 2 ) AND ( 1=1 and a.is_on = 1 and a.expir' at line 1
Database Status
Error Code 10501
Error Message 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 ( a.goods_type between 0 and 2 ) AND ( 1=1 and a.is_on = 1 and a.expir' at line 1
Error SQL SELECT `a`.*,`b`.`coupon_id`,`b`.`coupon_total_count`,`b`.`coupon_remain_count`,`b`.`commission_type`,`b`.`commission_rate`,`b`.`coupon_info`,`u`.`username`,`u`.`avatar`,`u`.`qq` FROM `zq_goods` `a` LEFT JOIN `zq_coupon` `b` ON `a`.`num_iid`=`b`.`goods_id` LEFT JOIN `zq_seller` `c` ON `a`.`zq_id`=`c`.`user_id` LEFT JOIN `zq_seller_info` `u` ON `c`.`id`=`u`.`seller_id` WHERE ( a.cid = ) AND ( a.goods_type between 0 and 2 ) AND ( 1=1 and a.is_on = 1 and a.expiry + a.showtime > 1568824425 ) ORDER BY `volume` DESC LIMIT 10
Database Config
type mysql
hostname 127.0.0.1
database zuanqun
hostport
dsn
params []
charset utf8
prefix zq_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
result_type 2
resultset_type array
auto_timestamp false
datetime_format false
sql_explain false
builder
query \think\db\Query
break_reconnect false

Environment Variables

GET Data

item
5
platform
pc?platform=pc
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
PHP_APP_DEBUG
1
PHP_APP_TRACE
PHP_ZUANQUN_STATIC_DOMAIN
http://static.zuanqun.cn
PHP_ZUANQUN_SESSION_DOMAIN
.zuanqun.cn
HTTP_IS_HTML
1
HTTP_REQUEST_URL
/index.php?item=5&platform=pc?platform=pc
HTTP_DOCUMENT_URL
/index.php
HTTP_CMS_HOST
demo.zuanqun.cn
HTTP_PROXY_VERSION
zq_cms_1
HTTP_APP_KEY
66b283d5c2b3a3221221542db1295bd48b4ca727
HTTP_APP_ID
161249461
HTTP_REFERER
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_HOST
upgrade.zuanqun.cn
PATH_INFO
/update.html
REDIRECT_STATUS
200
SERVER_NAME
www.zuanqun.cn
SERVER_PORT
80
SERVER_ADDR
148.163.169.76
REMOTE_PORT
35336
REMOTE_ADDR
148.163.169.76
SERVER_SOFTWARE
nginx/1.14.0
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/zuanqun/public
DOCUMENT_URI
/index.php
REQUEST_URI
/update.html?item=5&platform=pc%3Fplatform%3Dpc
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/update.html&item=5&platform=pc%3Fplatform%3Dpc
SCRIPT_FILENAME
/www/wwwroot/zuanqun/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1568824425.6758
REQUEST_TIME
1568824425
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/zuanqun/public/../application/
EXTEND_PATH
/www/wwwroot/zuanqun/public/../library/
THINK_VERSION
5.0.20
THINK_START_TIME
1568824425.6769
THINK_START_MEM
367128
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/zuanqun/thinkphp/
LIB_PATH
/www/wwwroot/zuanqun/thinkphp/library/
CORE_PATH
/www/wwwroot/zuanqun/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/zuanqun/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/zuanqun/
VENDOR_PATH
/www/wwwroot/zuanqun/vendor/
RUNTIME_PATH
/www/wwwroot/zuanqun/runtime/
LOG_PATH
/www/wwwroot/zuanqun/runtime/log/
CACHE_PATH
/www/wwwroot/zuanqun/runtime/cache/
TEMP_PATH
/www/wwwroot/zuanqun/runtime/temp/
CONF_PATH
/www/wwwroot/zuanqun/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/www/wwwroot/zuanqun/addons/

test