[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 '-20,20' 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 `d`.`id`,`d`....', [], false, false) in Query.php line 225
  3. at Query->query('SELECT `d`.`id`,`d`....', [], false, false) in Query.php line 2297
  4. at Query->select() in Cases.php line 41
  5. at Cases->lists()
  6. at ReflectionMethod->invokeArgs(object(Cases), []) in App.php line 224
  7. at App::invokeMethod([object(Cases), 'lists'], []) in App.php line 397
  8. at App::module(['index', 'cases', 'lists'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 130
  9. at App::run() in start.php line 18
  10. at require('D:\WebSite\KuanCe\th...') 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 '-20,20' 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 '-20,20' at line 1
Error SQL
SELECT `d`.`id`,`d`.`title`,`d`.`mianji`,`d`.`cover`,t.title as trade_name FROM `os_case` `d` LEFT JOIN `os_enum` `t` ON `d`.`trade`=`t`.`childid` WHERE `d`.`trade` = '306' ORDER BY d.sort asc,d.id desc LIMIT -20,20
Database Config
type
mysql
hostname
127.0.0.1
database
kuance
username
root
password
H83JHh83j7p6lsf16n1vswxn0
hostport
dsn
params
[]
charset
utf8
prefix
os_
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
empty
POST Data
empty
Files
empty

Cookies

user_code
2d2b4b25c17a8bdb0d005f4d198c4ee5
Session
empty

Server/Request Data

_FCGI_X_PIPE_
\\.\pipe\IISFCGI-8d169347-af89-4536-89fb-06025b38e430
PHP_FCGI_MAX_REQUESTS
10000
ALLUSERSPROFILE
C:\ProgramData
APPDATA
C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_CONFIG
APP_POOL_ID
CommonProgramFiles
C:\Program Files\Common Files
CommonProgramFiles(x86)
C:\Program Files (x86)\Common Files
CommonProgramW6432
C:\Program Files\Common Files
COMPUTERNAME
iZ114eb4fhlZ
ComSpec
C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK
NO
LOCALAPPDATA
C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS
8
OS
Windows_NT
Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;d:\Program Files\Microsoft SQL Server\100\Tools\Binn\;d:\Program Files\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;d:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE
AMD64
PROCESSOR_IDENTIFIER
Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
PROCESSOR_LEVEL
6
PROCESSOR_REVISION
3e04
ProgramData
C:\ProgramData
ProgramFiles
C:\Program Files
ProgramFiles(x86)
C:\Program Files (x86)
ProgramW6432
C:\Program Files
PSModulePath
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC
C:\Users\Public
SystemDrive
C:
SystemRoot
C:\Windows
TEMP
C:\Windows\TEMP
TMP
C:\Windows\TEMP
USERDOMAIN
WORKGROUP
USERNAME
iZ114eb4fhlZ$
USERPROFILE
C:\Windows\system32\config\systemprofile
windir
C:\Windows
windows_tracing_flags
3
windows_tracing_logfile
C:\BVTBin\Tests\installpackage\csilogfile.log
ORIG_PATH_INFO
/index.php/index/cases/lists/trade/306/page/0.html
URL
/index.php
SERVER_SOFTWARE
Microsoft-IIS/7.5
SERVER_PROTOCOL
HTTP/1.1
SERVER_PORT_SECURE
0
SERVER_PORT
80
SERVER_NAME
www.kuance.com
SCRIPT_NAME
/index.php
SCRIPT_FILENAME
D:\WebSite\KuanCe\index.php
REQUEST_URI
/index/cases/lists/trade/306/page/0.html
REQUEST_METHOD
GET
REMOTE_USER
REMOTE_PORT
20000
REMOTE_HOST
154.210.66.198
REMOTE_ADDR
154.210.66.198
QUERY_STRING
PATH_TRANSLATED
D:\WebSite\KuanCe\index.php\index\cases\lists\trade\306\page\0.html
PATH_INFO
/index/cases/lists/trade/306/page/0.html
LOGON_USER
LOCAL_ADDR
139.196.105.3
INSTANCE_META_PATH
/LM/W3SVC/9
INSTANCE_NAME
INSTANCE_ID
9
HTTPS_SERVER_SUBJECT
HTTPS_SERVER_ISSUER
HTTPS_SECRETKEYSIZE
HTTPS_KEYSIZE
HTTPS
off
GATEWAY_INTERFACE
CGI/1.1
DOCUMENT_ROOT
D:\WebSite\KuanCe
CONTENT_TYPE
CONTENT_LENGTH
0
CERT_SUBJECT
CERT_SERIALNUMBER
CERT_ISSUER
CERT_FLAGS
CERT_COOKIE
AUTH_USER
AUTH_PASSWORD
AUTH_TYPE
APPL_PHYSICAL_PATH
D:\WebSite\KuanCe\
APPL_MD_PATH
/LM/W3SVC/9/ROOT
IIS_UrlRewriteModule
7.1.0871.0
UNENCODED_URL
/index/cases/lists/trade/306/page/0.html
IIS_WasUrlRewritten
1
HTTP_X_ORIGINAL_URL
/index/cases/lists/trade/306/page/0.html
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.kuance.com
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_CONTENT_LENGTH
0
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php/index/cases/lists/trade/306/page/0.html
REQUEST_TIME_FLOAT
1639020575.1908
REQUEST_TIME
1639020575
Environment Variables
empty

ThinkPHP Constants

APP_PATH
D:\WebSite\KuanCe/application/
THINK_VERSION
5.0.7
THINK_START_TIME
1639020575.1937
THINK_START_MEM
270864
EXT
.php
DS
\
THINK_PATH
D:\WebSite\KuanCe\thinkphp\
LIB_PATH
D:\WebSite\KuanCe\thinkphp\library\
CORE_PATH
D:\WebSite\KuanCe\thinkphp\library\think\
TRAIT_PATH
D:\WebSite\KuanCe\thinkphp\library\traits\
ROOT_PATH
D:\WebSite\KuanCe\
EXTEND_PATH
D:\WebSite\KuanCe\extend\
VENDOR_PATH
D:\WebSite\KuanCe\vendor\
RUNTIME_PATH
D:\WebSite\KuanCe\runtime\
LOG_PATH
D:\WebSite\KuanCe\runtime\log\
CACHE_PATH
D:\WebSite\KuanCe\runtime\cache\
TEMP_PATH
D:\WebSite\KuanCe\runtime\temp\
CONF_PATH
D:\WebSite\KuanCe/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
true