[10501] PDOException in Connection.php line 362

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>1572424271 AND poolreason' at line 1

  1. // 参数绑定
  2. $this->bindValue($bind);
  3. // 执行查询
  4. $result = $this->PDOStatement->execute();
  5. // 调试结束
  6. $this->debug(false);
  7. $procedure = in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']);
  8. return $this->getResult($class, $procedure);
  9. } catch (\PDOException $e) {
  10. throw new PDOException($e, $this->config, $this->queryStr);
  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 362
  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 151
  4. at Db::__callStatic('query', ['select count(id) as ...']) in Esf.php line 353
  5. at Esf->esf_frontlist(['type' => '1'], 'shi=2 AND ', 'istop desc,refreshda...', 1) in EsfFront.php line 239
  6. at EsfFront->index()
  7. at ReflectionMethod->invokeArgs(object(EsfFront), []) in App.php line 234
  8. at App::invokeMethod([object(EsfFront), 'index'], []) in App.php line 405
  9. at App::module([null, 'esf_front', 'index'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 140
  10. at App::run() in start.php line 17
  11. 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>1572424271 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>1572424271 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 shi=2 AND AND a.status = 1 AND type=1 AND ( last_protect_time>1572424271 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 shi=2 AND AND a.status = 1 AND type=1 AND ( last_protect_time>1572424271 AND poolreason=0) AND a.isother=1 AND a.is_price_expire=0 UNION SELECT a.id from cms_esf_temp as a where shi=2 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
username
oa
password
Yb8217042cC!@#
hostport
3063
dsn
params
[]
charset
utf8mb4
prefix
cms_
debug
true
deploy
0
rw_separate
false
master_num
1
slave_no
fields_strict
true
resultset_type
array
auto_timestamp
true
sql_explain
false
builder
query
\think\db\Query

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
_FCGI_X_PIPE_
\\.\pipe\IISFCGI-dd7afee0-5347-4f03-9305-8fb7aee8d3db
PHP_FCGI_MAX_REQUESTS
10000
PHPRC
C:\App\Php\7\
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\Mysql\5\bin\;C:\App\Php\7;C:\ProgramData\ComposerSetup\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-shi-2-fl-8.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-shi-2-fl-8.html
REQUEST_METHOD
GET
REMOTE_USER
REMOTE_PORT
22818
REMOTE_HOST
162.158.119.87
REMOTE_ADDR
162.158.119.87
QUERY_STRING
PATH_TRANSLATED
D:\web\2017\esf_front\index.php\cs-shi-2-fl-8.html
PATH_INFO
/cs-shi-2-fl-8.html
LOGON_USER
LOCAL_ADDR
171.8.71.76
INSTANCE_META_PATH
/LM/W3SVC/1
INSTANCE_NAME
WWW
INSTANCE_ID
1
HTTPS_SERVER_SUBJECT
OU=Domain Control Validated, OU=PositiveSSL Wildcard, 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
WEBSOCKET_VERSION
13
IIS_UrlRewriteModule
7,1,1993,2336
UNENCODED_URL
/esf/cs-shi-2-fl-8.html
IIS_WasUrlRewritten
1
HTTP_X_ORIGINAL_URL
/esf/cs-shi-2-fl-8.html
HTTP_CDN_LOOP
cloudflare
HTTP_CF_CONNECTING_IP
154.92.103.36
HTTP_CF_VISITOR
{"scheme":"https"}
HTTP_X_FORWARDED_PROTO
https
HTTP_CF_RAY
544ed23c8ab0944f-NRT
HTTP_X_FORWARDED_FOR
154.92.103.36
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-shi-2-fl-8.html
REQUEST_TIME_FLOAT
1576312271.646
REQUEST_TIME
1576312271
ALL_HTTP
Environment Variablesempty
ThinkPHP Constants
APP_PATH
D:\web\2017\esf_front/../include/
BIND_MODULE
esf
THINK_VERSION
5.0.4
THINK_START_TIME
1576312271.6488
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