[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 t1.id <> '27' ) ORDER BY `t1`.`is_top` DESC,`t1`.`recommended` DESC,`t1`.`i' 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 `t1`.`id`,`t1...', ['where_AND_recommended' => [1, 1]], false, false) in Query.php line 255
  3. at Query->query('SELECT `t1`.`id`,`t1...', ['where_AND_recommended' => [1, 1]], false, false) in Query.php line 2523
  4. at Query->select() in BusiController.php line 540
  5. at BusiController->online_detail()
  6. at ReflectionMethod->invokeArgs(object(BusiController), []) in App.php line 343
  7. at App::invokeMethod([object(BusiController), 'online_detail'], []) in App.php line 611
  8. at App::module(['portal', 'busi', 'online_detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 457
  9. at App::exec(['type' => 'module', 'module' => ['portal', 'busi', 'online_detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  10. at App::run() in index.php line 68

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 t1.id <> '27' ) ORDER BY `t1`.`is_top` DESC,`t1`.`recommended` DESC,`t1`.`i' 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 t1.id <> '27' ) ORDER BY `t1`.`is_top` DESC,`t1`.`recommended` DESC,`t1`.`i' at line 1
Error SQL SELECT `t1`.`id`,`t1`.`create_time`,`t1`.`published_time`,`t1`.`title`,`t1`.`brief`,`t1`.`image` FROM `cmf_info` `t1` WHERE `t1`.`delete_time` = 0 AND `t1`.`is_show` = 1 AND `recommended` = 1 AND ( t1.cat_id = and t1.id <> '27' ) ORDER BY `t1`.`is_top` DESC,`t1`.`recommended` DESC,`t1`.`id` DESC LIMIT 4
Database Config
type mysql
hostname 127.0.0.1
database shyzhjz
hostport 3306
dsn
params []
charset utf8
prefix cmf_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
result_type 2
resultset_type collection
auto_timestamp false
datetime_format false
sql_explain false
builder
query \think\db\Query
break_reconnect false
authcode 3WpL6SOZ8s5r1poMQc

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

SITE_ID
1
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/shyzhjz.sz2.vchengmu.com/index.php
QUERY_STRING
s=/portal/busi/online_detail/id/27.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/portal/busi/online_detail/id/27.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/shyzhjz.sz2.vchengmu.com
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.16.0
REMOTE_ADDR
34.229.173.107
REMOTE_PORT
42154
SERVER_ADDR
172.19.220.155
SERVER_PORT
80
SERVER_NAME
shyzhjz.sz2.vchengmu.com
REDIRECT_STATUS
200
PATH_INFO
/portal/busi/online_detail/id/27.html
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
shyzhjz.sz2.vchengmu.com
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711701000.0321
REQUEST_TIME
1711701000
Environment Variables
empty

ThinkPHP Constants

url
/portal/busi/online_detail/id/27.html
ent
claudebot
site
http://jt.cds98.com:90/
road
?road=shyzhjz.sz2.vchengmu.com/portal/busi/online_detail/id/27.html
waps
@Android|Browser|Mobile|Wap|iOs|aiduboxapp|iPad|iPhone|iPod@i
regs
@Baidu|Sogou|Yisou|Sm.cn|Bytespider|360|So.com|Toutiao.com@i
area
false
APP_DEBUG
true
CMF_ROOT
/data/wwwroot/shyzhjz.sz2.vchengmu.com/
APP_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/app/
CMF_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/cmf/
PLUGINS_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/plugins/
EXTEND_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/extend/
VENDOR_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/vendor/
RUNTIME_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/data/runtime/
THINKCMF_VERSION
5.0.170927
SO
is_top DESC,list_order DESC,published_time DESC,post_id DESC
GSO
is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC
TMPLSO
order:is_top DESC,list_order DESC,published_time DESC,post_id DESC;
TMPLGSO
order:is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC;
WEB_ROOT
/data/wwwroot/shyzhjz.sz2.vchengmu.com/
TPL_PHONE
false
IS_WAP
false
THINK_VERSION
5.0.24
THINK_START_TIME
1711701000.0327
THINK_START_MEM
277064
EXT
.php
DS
/
THINK_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/thinkphp/
LIB_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/thinkphp/library/
CORE_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/
LOG_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/data/runtime/log/
CACHE_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/data/runtime/cache/
TEMP_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/data/runtime/temp/
CONF_PATH
/data/wwwroot/shyzhjz.sz2.vchengmu.com/app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/data/wwwroot/shyzhjz.sz2.vchengmu.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.7