[10501] PDOException in Connection.php line 388

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 `c_id` = ? AND `examine` = ? ORDER BY createtime desc LIMIT 2' at line 1

  1. $this->PDOStatement->execute();
  2. // 调试结束
  3. $this->debug(false);
  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 388
  2. at Connection->query('SELECT * FROM `lj_co...', ['where_c_id' => ['', 2], 'where_examine' => [1, 2]], false, false) in Query.php line 227
  3. at Query->query('SELECT * FROM `lj_co...', ['where_c_id' => ['', 2], 'where_examine' => [1, 2]], false, false) in Query.php line 2342
  4. at Query->select() in Single.php line 408
  5. at Single->forumdetail()
  6. at ReflectionMethod->invokeArgs(object(Single), []) in App.php line 343
  7. at App::invokeMethod([object(Single), 'forumdetail'], []) in App.php line 598
  8. at App::module(['index', 'Single', 'forumdetail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  9. at App::exec(['type' => 'module', 'module' => 'index/Single/forumde...'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  10. at App::run() in start.php line 19
  11. at require('/www/wwwroot/www.ron...') in index.php line 17

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 `c_id` = ? AND `examine` = ? ORDER BY createtime desc LIMIT 2' 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 `c_id` = ? AND `examine` = ? ORDER BY createtime desc LIMIT 2' at line 1
Error SQL SELECT * FROM `lj_comment` WHERE ( blog_id= ) AND `c_id` = '' AND `examine` = '1' ORDER BY createtime desc LIMIT 2
Database Config
type mysql
hostname 127.0.0.1
database www_rongpeng_com
hostport 3306
dsn
params []
charset utf8
prefix lj_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
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
can_translate_table { "product": "\u5546\u54c1\u8868", "news": "\u65b0\u95fb\u8868", "category": "\u5206\u7c7b\u8868", "navigation": "\u5bfc\u822a\u8868" }

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

lang
en
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_X_ALICDN_DA_VIA
47.246.24.201,163.181.67.243,163.181.32.248
HTTP_ALI_CDN_APPVIEW_NAME
cdn-tengine
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_ALI_SWIFT_FORCE_TTL_CODE
400=0
HTTP_X_CLIENT_SCHEME
https
HTTP_X_FORWARDED_FOR
3.236.214.123
HTTP_ALI_SWIFT_STAT_HOST
www.rongpeng.com
HTTP_ALI_SWIFT_LOG_HOST
www.rongpeng.com
HTTP_ALI_CDN_REAL_IP
3.236.214.123
HTTP_ALI_CDN_REAL_PORT
60626
HTTP_EAGLEEYE_TRACEID
2ff6189717116455333316022e
HTTP_VIA
us18.l1, l2us1.l2, l2hk2.l2
HTTP_HOST
www.rongpeng.com
PATH_INFO
/single/forumdetail
REDIRECT_STATUS
200
SERVER_NAME
www.rongpeng.com
SERVER_PORT
443
SERVER_ADDR
172.21.93.57
REMOTE_PORT
34646
REMOTE_ADDR
163.181.32.160
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/www.rongpeng.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/single/forumdetail
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/single/forumdetail
SCRIPT_FILENAME
/www/wwwroot/www.rongpeng.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711645533.4507
REQUEST_TIME
1711645533
Environment Variables
empty

ThinkPHP Constants

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