[10501] PDOException in Connection.php line 399

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 '-30,1' 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->config['break_reconnect'] && $this->isBreak($e)) {
  8. return $this->close()->query($sql, $bind, $master, $pdo);
  9. }
  10. throw new PDOException($e, $this->config, $this->getLastsql());
  11. }
  12. }
  13. /**
  14. * 执行语句
  15. * @access public
  16. * @param string $sql sql指令
  17. * @param array $bind 参数绑定
  18. * @return int

Call Stack

  1. in Connection.php line 399
  2. at Connection->query('SELECT `id` FROM `mx...', ['where_cid_in_0' => [49, 1], 'where_cid_in_1' => [50, 1], 'where_cid_in_2' => [51, 1], ...], false, false) in Query.php line 225
  3. at Query->query('SELECT `id` FROM `mx...', ['where_cid_in_0' => [49, 1], 'where_cid_in_1' => [50, 1], 'where_cid_in_2' => [51, 1], ...], false, false) in Query.php line 2297
  4. at Query->select() in Error.php line 544
  5. at Error->city_category('manzhouli', 'baiyexinxi', 0) in Error.php line 65
  6. at Error->index(object(Request))
  7. at ReflectionMethod->invokeArgs(object(Error), [object(Request)]) in App.php line 224
  8. at App::invokeMethod([object(Error), 'index'], []) in App.php line 395
  9. at App::module(['index', 'dm67', null], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 130
  10. at App::run() in start.php line 18
  11. at require('/www/wwwroot/www.dm6...') in index.php line 61

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 '-30,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 '-30,1' at line 1
Error SQL SELECT `id` FROM `mx8_article` WHERE `cid` IN (49,50,51,52,53,54,65) AND `city_id` = 219 ORDER BY id desc LIMIT -30,1
Database Config
type mysql
hostname 127.0.0.1
database dm_67_new
username dm_67_new
password zHtmeixh77m8Yh7L
hostport 3306
dsn
params []
charset utf8
prefix mx8_
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

Environment Variables

GET Data

citx
8
dmg
0.html
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/dm67/?citx=8&dmg=0.html
QUERY_STRING
citx=8&dmg=0.html
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
citx=8&dmg=0.html
REDIRECT_URL
/dm67/
REMOTE_PORT
5139
SCRIPT_FILENAME
/www/wwwroot/www.dm67.com/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/www.dm67.com
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
/www/wwwroot/www.dm67.com
REMOTE_ADDR
3.145.23.123
SERVER_PORT
80
SERVER_ADDR
192.168.0.38
SERVER_NAME
manzhouli.dm67.com
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
<address>Apache Server at manzhouli.dm67.com Port 80</address>
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOST
manzhouli.dm67.com
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
proxy-nokeepalive
1
REDIRECT_STATUS
200
REDIRECT_PATH_INFO
dm67/
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1713455227.6303
REQUEST_TIME
1713455227
PATH_INFO
dm67/
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
false
SITE_PATH
/www/wwwroot/www.dm67.com/
EXTEND_PATH
/www/wwwroot/www.dm67.com/extend/
APP_PATH
/www/wwwroot/www.dm67.com/application/
BIND_MODULE
index
THINK_VERSION
5.0.7
THINK_START_TIME
1713455227.6306
THINK_START_MEM
419208
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.dm67.com/thinkphp/
LIB_PATH
/www/wwwroot/www.dm67.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.dm67.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.dm67.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.dm67.com/
VENDOR_PATH
/www/wwwroot/www.dm67.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.dm67.com/runtime/
LOG_PATH
/www/wwwroot/www.dm67.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.dm67.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.dm67.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.dm67.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false