[10501] PDOException in Connection.php line 687

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 ') ORDER BY `id` DESC LIMIT 1' at line 1

  1. $this->debug(false, '', $master);
  2. // 返回结果集
  3. return $this->getResult($pdo, $procedure);
  4. } catch (\PDOException $e) {
  5. if ($this->isBreak($e)) {
  6. return $this->close()->query($sql, $bind, $master, $pdo);
  7. }
  8. throw new PDOException($e, $this->config, $this->getLastsql());
  9. } catch (\Throwable $e) {
  10. if ($this->isBreak($e)) {
  11. return $this->close()->query($sql, $bind, $master, $pdo);
  12. }
  13. throw $e;
  14. } catch (\Exception $e) {
  15. if ($this->isBreak($e)) {
  16. return $this->close()->query($sql, $bind, $master, $pdo);

Call Stack

  1. in Connection.php line 687
  2. at Connection->query('SELECT * FROM `kend_...', [], false, false) in Connection.php line 844
  3. at Connection->find(object(Query)) in Query.php line 3130
  4. at Query->find() in BaseController.php line 34
  5. at BaseController->getFind('article', 'id < 31 AND type_id ...', 'id DESC') in BaseController.php line 64
  6. at BaseController->getDetail('article', '31', true) in NewsController.php line 45
  7. at NewsController->detail(object(Request))
  8. at ReflectionMethod->invokeArgs(object(NewsController), [object(Request)]) in Container.php line 395
  9. at Container->invokeReflectMethod(object(NewsController), object(ReflectionMethod), ['id' => '31']) in Module.php line 132
  10. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  11. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  12. at Middleware->think\{closure}(object(Request))
  13. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  14. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  15. at Module->exec() in Dispatch.php line 168
  16. at Dispatch->run() in App.php line 432
  17. at App->think\{closure}(object(Request), object(Closure), null)
  18. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  19. at Middleware->think\{closure}(object(Request))
  20. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  21. at Middleware->dispatch(object(Request)) in App.php line 435
  22. at App->run() in index.php line 21

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 ') ORDER BY `id` DESC 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 ') ORDER BY `id` DESC LIMIT 1' at line 1
Error SQL SELECT * FROM `kend_article` WHERE ( id < 31 AND type_id = ) ORDER BY `id` DESC LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database mdgpet
hostport 3306
dsn
params []
charset utf8
prefix kend_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
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
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
_FCGI_X_PIPE_ \\.\pipe\IISFCGI-128743f5-7eea-44c2-8d69-aa59af2ce12e
PHPRC D:\SOFT_PHP_PACKAGE\php5.6
PHP_FCGI_MAX_REQUESTS 10000
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_CONFIG C:\inetpub\temp\apppools\public\public.config
APP_POOL_ID public
CommonProgramFiles C:\Program Files (x86)\Common Files
CommonProgramFiles(x86) C:\Program Files (x86)\Common Files
CommonProgramW6432 C:\Program Files\Common Files
COMPUTERNAME EBS-60098
ComSpec C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK NO
LOCALAPPDATA C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS 4
OS Windows_NT
Path D:\SOFT_PHP_PACKAGE\php;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\SOFT_PHP_PACKAGE\mysql\bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\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 x86
PROCESSOR_ARCHITEW6432 AMD64
PROCESSOR_IDENTIFIER Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 3f02
ProgramData C:\ProgramData
ProgramFiles C:\Program Files (x86)
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 EBS-60098$
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/home/news/detail/id/31.html
URL /index.php
SERVER_SOFTWARE Microsoft-IIS/7.5
SERVER_PROTOCOL HTTP/1.0
SERVER_PORT_SECURE 0
SERVER_PORT 80
SERVER_NAME www.mdgpet.com
SCRIPT_NAME /index.php
SCRIPT_FILENAME D:\wwwroot\mdgpet\wwwroot\public\index.php
REQUEST_URI /home/news/detail/id/31.html
REQUEST_METHOD GET
REMOTE_USER
REMOTE_PORT 3602
REMOTE_HOST 127.0.0.1
REMOTE_ADDR 127.0.0.1
QUERY_STRING
PATH_TRANSLATED D:\wwwroot\mdgpet\wwwroot\public\index.php\home\news\detail\id\31.html
PATH_INFO /home/news/detail/id/31.html
LOGON_USER
LOCAL_ADDR 127.0.0.1
INSTANCE_META_PATH /LM/W3SVC/10064
INSTANCE_NAME MDGPET
INSTANCE_ID 10064
HTTPS_SERVER_SUBJECT
HTTPS_SERVER_ISSUER
HTTPS_SECRETKEYSIZE
HTTPS_KEYSIZE
HTTPS off
GATEWAY_INTERFACE CGI/1.1
DOCUMENT_ROOT D:\wwwroot\mdgpet\wwwroot\public
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:\wwwroot\mdgpet\wwwroot\public\
APPL_MD_PATH /LM/W3SVC/10064/ROOT
IIS_UrlRewriteModule 7.1.0871.0
UNENCODED_URL /home/news/detail/id/31.html
IIS_WasUrlRewritten 1
HTTP_X_ORIGINAL_URL /home/news/detail/id/31.html
HTTP_CDN_LOOP cloudflare
HTTP_CF_CONNECTING_IP 23.82.214.71
HTTP_CF_VISITOR {"scheme":"http"}
HTTP_X_FORWARDED_PROTO http
HTTP_CF_RAY 4dd184d198ad5f3d-LAS
HTTP_CF_IPCOUNTRY US
HTTP_X_REAL_IP 162.158.246.12
HTTP_X_FORWARDED_FOR 23.82.214.71, 162.158.246.12
HTTP_USER_AGENT Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST www.mdgpet.com
HTTP_ACCEPT_ENCODING gzip
HTTP_ACCEPT */*
HTTP_CONTENT_LENGTH 0
HTTP_CONNECTION close
FCGI_ROLE RESPONDER
PHP_SELF /index.php/home/news/detail/id/31.html
REQUEST_TIME_FLOAT 1558892265.2471
REQUEST_TIME 1558892265
Environment Variablesempty
ThinkPHP Constantsempty