[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 'and status = 0 ) 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 2471
  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 common.php line 882
  8. at admin_cb_price(null) in Index.php line 359
  9. at Index->good()
  10. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 343
  11. at App::invokeMethod([object(Index), 'good'], []) in App.php line 611
  12. at App::module(['pc', 'index', 'good'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  13. at App::exec(['type' => 'module', 'module' => ['pc', 'index', 'good']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  14. at App::run() in start.php line 19
  15. at require('/home/www/svip.66ya....') in index.php line 46

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 status = 0 ) 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 'and status = 0 ) LIMIT 1' at line 1
Error SQL SELECT COUNT(*) AS tp_count FROM `bg_goods_card` WHERE ( good_id = and status = 0 ) LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database svip_66ya_cn
hostport
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

good_id
460319
page
good_type
15825
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_HOST
mai.greewe.cn
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
PATH_INFO
/pc/index/good
REDIRECT_STATUS
200
SERVER_NAME
*.66ya.cn
SERVER_PORT
80
SERVER_ADDR
103.215.37.37
REMOTE_PORT
49164
REMOTE_ADDR
35.172.193.238
SERVER_SOFTWARE
nginx/1.18.0
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/home/www/svip.66ya.cn/public
DOCUMENT_URI
/index.php
REQUEST_URI
/pc/index/good?good_id=460319&page=&good_type=15825
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/pc/index/good&good_id=460319&page=&good_type=15825
SCRIPT_FILENAME
/home/www/svip.66ya.cn/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711629344.3823
REQUEST_TIME
1711629344
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/www/svip.66ya.cn/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711629344.3847
THINK_START_MEM
424376
EXT
.php
DS
/
THINK_PATH
/home/www/svip.66ya.cn/thinkphp/
LIB_PATH
/home/www/svip.66ya.cn/thinkphp/library/
CORE_PATH
/home/www/svip.66ya.cn/thinkphp/library/think/
TRAIT_PATH
/home/www/svip.66ya.cn/thinkphp/library/traits/
ROOT_PATH
/home/www/svip.66ya.cn/
EXTEND_PATH
/home/www/svip.66ya.cn/extend/
VENDOR_PATH
/home/www/svip.66ya.cn/vendor/
RUNTIME_PATH
/home/www/svip.66ya.cn/runtime/
LOG_PATH
/home/www/svip.66ya.cn/runtime/log/
CACHE_PATH
/home/www/svip.66ya.cn/runtime/cache/
TEMP_PATH
/home/www/svip.66ya.cn/runtime/temp/
CONF_PATH
/home/www/svip.66ya.cn/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false