[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 a.status = 1 AND type=1 AND ( last_protect_time>1578489456 AND poolreason' 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(id) as ...')
  3. at call_user_func_array([object(Mysql), 'query'], ['select count(id) as ...']) in Db.php line 178
  4. at Db::__callStatic('query', ['select count(id) as ...']) in Esf.php line 353
  5. at Esf->esf_frontlist(['type' => '1'], 'mj>=50 AND mj<=70 AN...', 'istop desc,refreshda...', 1) in EsfFront.php line 239
  6. at EsfFront->index()
  7. at ReflectionMethod->invokeArgs(object(EsfFront), []) in App.php line 343
  8. at App::invokeMethod([object(EsfFront), 'index'], []) in App.php line 611
  9. at App::module([null, 'esf_front', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  10. at App::exec(['type' => 'module', 'module' => [null, 'esf_front', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  11. at App::run() in start.php line 19
  12. at require('D:\web\2017\core\sta...') in index.php line 19

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 a.status = 1 AND type=1 AND ( last_protect_time>1578489456 AND poolreason' 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 a.status = 1 AND type=1 AND ( last_protect_time>1578489456 AND poolreason' at line 1
Error SQL
select count(id) as allnum from ( SELECT a.id FROM cms_esf a INNER JOIN cms_home w ON a.fid =w.id LEFT JOIN cms_build b ON b.id =w.bid LEFT JOIN cms_house c ON c.id =b.pid LEFT JOIN cms_huxing h ON w.hid=h.id WHERE mj>=50 AND mj<=70 AND AND a.status = 1 AND type=1 AND ( last_protect_time>1578489456 AND poolreason=0) AND a.isother=0 AND a.is_price_expire=0 UNION SELECT a.id from cms_esf a INNER JOIN cms_home_other h ON a.fid=h.id WHERE mj>=50 AND mj<=70 AND AND a.status = 1 AND type=1 AND ( last_protect_time>1578489456 AND poolreason=0) AND a.isother=1 AND a.is_price_expire=0 UNION SELECT a.id from cms_esf_temp as a where mj>=50 AND mj<=70 AND AND a.status = 1 AND type=1 AND a.lock=0 AND a.checked=2 AND a.isweituo=0 ) as cms_esf_union
Database Config
type
mysql
hostname
127.0.0.1
database
db2017
hostport
3063
dsn
params
[]
charset
utf8mb4
prefix
cms_
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
true
datetime_format
Y-m-d H:i:s
sql_explain
false
builder
query
\think\db\Query
break_reconnect
false

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

_FCGI_X_PIPE_
\\.\pipe\IISFCGI-20de77f6-01fc-485c-9fb3-98b89b92fa33
PHPRC
C:\App\Php\7\
PHP_FCGI_MAX_REQUESTS
10000
ALLUSERSPROFILE
C:\ProgramData
APPDATA
C:\Windows\system32\config\systemprofile\AppData\Roaming
APP_POOL_CONFIG
C:\inetpub\temp\apppools\www\www.config
APP_POOL_ID
www
CommonProgramFiles
C:\Program Files\Common Files
CommonProgramFiles(x86)
C:\Program Files (x86)\Common Files
CommonProgramW6432
C:\Program Files\Common Files
COMPUTERNAME
WIN-17LAO2L8R6U
ComSpec
C:\Windows\system32\cmd.exe
LOCALAPPDATA
C:\Windows\system32\config\systemprofile\AppData\Local
NUMBER_OF_PROCESSORS
24
OS
Windows_NT
Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\App\Apache\bin\;C:\Program Files\Microsoft\Web Platform Installer\;C:\App\Php\7;C:\ProgramData\ComposerSetup\bin;C:\App\Php\5;C:\App\Mysql\bin;C:\App\Mysql8\bin;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
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:\Program Files\WindowsPowerShell\Modules;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
WIN-17LAO2L8R6U$
USERPROFILE
C:\Windows\system32\config\systemprofile
windir
C:\Windows
ORIG_PATH_INFO
/esf/index.php/cs-mj-2-fl-6.html
URL
/esf/index.php
SERVER_SOFTWARE
Microsoft-IIS/10.0
SERVER_PROTOCOL
HTTP/1.1
SERVER_PORT_SECURE
1
SERVER_PORT
443
SERVER_NAME
www.0831home.com
SCRIPT_NAME
/esf/index.php
SCRIPT_FILENAME
D:\web\2017\esf_front\index.php
REQUEST_URI
/esf/cs-mj-2-fl-6.html
REQUEST_METHOD
GET
REMOTE_USER
REMOTE_PORT
52664
REMOTE_HOST
172.69.134.171
REMOTE_ADDR
172.69.134.171
QUERY_STRING
PATH_TRANSLATED
D:\web\2017\esf_front\index.php\cs-mj-2-fl-6.html
PATH_INFO
/cs-mj-2-fl-6.html
LOGON_USER
LOCAL_ADDR
171.8.71.76
INSTANCE_META_PATH
/LM/W3SVC/1
INSTANCE_NAME
WWW
INSTANCE_ID
1
HTTPS_SERVER_SUBJECT
CN=*.0831home.com
HTTPS_SERVER_ISSUER
C=GB, S=Greater Manchester, L=Salford, O=Sectigo Limited, CN=Sectigo RSA Domain Validation Secure Server CA
HTTPS_SECRETKEYSIZE
2048
HTTPS_KEYSIZE
256
HTTPS
on
GATEWAY_INTERFACE
CGI/1.1
DOCUMENT_ROOT
D:\web\2015
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:\web\2015\
APPL_MD_PATH
/LM/W3SVC/1/ROOT
IIS_UrlRewriteModule
7,1,1993,2351
WEBSOCKET_VERSION
13
UNENCODED_URL
/esf/cs-mj-2-fl-6.html
IIS_WasUrlRewritten
1
HTTP_X_ORIGINAL_URL
/esf/cs-mj-2-fl-6.html
HTTP_CDN_LOOP
cloudflare
HTTP_CF_CONNECTING_IP
154.92.103.143
HTTP_CF_VISITOR
{"scheme":"https"}
HTTP_X_FORWARDED_PROTO
https
HTTP_CF_RAY
56913da70e3fc327-SIN
HTTP_X_FORWARDED_FOR
154.92.103.143
HTTP_CF_IPCOUNTRY
HK
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.0831home.com
HTTP_ACCEPT_ENCODING
gzip
HTTP_ACCEPT
*/*
HTTP_CONTENT_LENGTH
0
HTTP_CONNECTION
Keep-Alive
FCGI_ROLE
RESPONDER
PHP_SELF
/esf/index.php/cs-mj-2-fl-6.html
REQUEST_TIME_FLOAT
1582377456.6627
REQUEST_TIME
1582377456
ALL_HTTP
Environment Variables
empty

ThinkPHP Constants

APP_PATH
D:\web\2017\esf_front/../include/
BIND_MODULE
esf
THINK_VERSION
5.0.24
THINK_START_TIME
1582377456.6653
THINK_START_MEM
407192
EXT
.php
DS
\
THINK_PATH
D:\web\2017\core\
LIB_PATH
D:\web\2017\core\library\
CORE_PATH
D:\web\2017\core\library\think\
TRAIT_PATH
D:\web\2017\core\library\traits\
ROOT_PATH
D:\web\2017\
EXTEND_PATH
D:\web\2017\extend\
VENDOR_PATH
D:\web\2017\vendor\
RUNTIME_PATH
D:\web\2017\runtime\
LOG_PATH
D:\web\2017\runtime\log\
CACHE_PATH
D:\web\2017\runtime\cache\
TEMP_PATH
D:\web\2017\runtime\temp\
CONF_PATH
D:\web\2017\esf_front/../include/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
true