[10501] PDOException in Connection.php line 385

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 ') ) ) LIMIT 1' 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 385
  2. at Connection->query('SELECT COUNT(*) AS t...', [], false, true) in Query.php line 255
  3. at Query->query('SELECT COUNT(*) AS t...', [], false, true) in Query.php line 2470
  4. at Query->getPdo() in Query.php line 441
  5. at Query->value('COUNT(*) AS tp_count', 0, true) in Query.php line 576
  6. at Query->aggregate('COUNT', '*', true) in Query.php line 551
  7. at Query->count() in Query.php line 1484
  8. at Query->paginate(20, false, ['query' => ['cat_id' => '608']]) in HomeCategory.php line 180
  9. at HomeCategory->GetGoodsInfo(['cat_id' => '608', 'keywords' => '', 'price_min' => 0, ...]) in Category.php line 113
  10. at Category->index()
  11. at ReflectionMethod->invokeArgs(object(Category), []) in App.php line 343
  12. at App::invokeMethod([object(Category), 'index'], []) in App.php line 611
  13. at App::module(['home', 'Category', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  14. at App::exec(['type' => 'module', 'module' => ['home', 'Category', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  15. at App::run() in start.php line 19
  16. at require('/www/wwwroot/medical...') in index.php line 19

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 ') ) ) LIMIT 1' 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 ') ) ) LIMIT 1' at line 1
Error SQL SELECT COUNT(*) AS tp_count FROM `trt_goods` WHERE ( is_delete=0 and goods_type=0 and is_on_sale=1 and ( cat_id in () ) ) LIMIT 1
Database Config
type mysql
hostname rm-2ze67221nn5d4w385fo.mysql.rds.aliyuncs.com
database dashangchuangecshop
hostport 3306
dsn
params []
charset utf8
prefix
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 Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty

Session

think
{ "provinceId": 2 }

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/medical/public/index.php
QUERY_STRING
s=/home/CategoryIndex/608.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/home/CategoryIndex/608.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/medical/public
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.24.0
REMOTE_ADDR
100.127.192.152
REMOTE_PORT
41436
SERVER_ADDR
172.17.169.229
SERVER_PORT
80
SERVER_NAME
tongrentangsxls.com
REDIRECT_STATUS
200
PATH_INFO
/home/CategoryIndex/608.html
HTTP_REMOTEIP
39.96.130.0
HTTP_HOST
www.tongrentangsxls.com
HTTP_X_FORWARDED_FOR
3.85.63.190, 39.96.130.0, 39.96.130.0
HTTP_CONNECTION
close
HTTP_USER_AGENT
claudebot
HTTP_EAGLEEYE_TRACEID
2760820017108384992962017e9dcb
HTTP_X_FORWARDED_CLUSTER
waf,
HTTP_ACCEPT
*/*
HTTP_EAGLEEYE_RPCID
0.1.1
HTTP_X_REAL_IP
39.96.130.0
HTTP_WL_PROXY_CLIENT_IP
39.96.130.0
HTTP_X_FORWARDED_PROTO
http
HTTP_X_TRUE_IP
39.96.130.0
HTTP_X_CLIENT_IP
39.96.130.0
HTTP_WEB_SERVER_TYPE
nginx
HTTP_X5_UUID
2659e7fa9ea42e1eb860f32926fa85a6
HTTP_X_SINFO
on
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1710838499.3024
REQUEST_TIME
1710838499
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/medical/public/../application/
EXTEND_PATH
/www/wwwroot/medical/public/../extend/
VENDOR_PATH
/www/wwwroot/medical/public/../vendor/
THINK_VERSION
5.0.24
THINK_START_TIME
1710838499.3026
THINK_START_MEM
241384
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/medical/thinkphp/
LIB_PATH
/www/wwwroot/medical/thinkphp/library/
CORE_PATH
/www/wwwroot/medical/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/medical/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/medical/
RUNTIME_PATH
/www/wwwroot/medical/runtime/
LOG_PATH
/www/wwwroot/medical/runtime/log/
CACHE_PATH
/www/wwwroot/medical/runtime/cache/
TEMP_PATH
/www/wwwroot/medical/runtime/temp/
CONF_PATH
/www/wwwroot/medical/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false