[10501] PDOException in Connection.phphtml line 390

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 'htm ) LIMIT 1' 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.phphtml line 390
  2. at Connection->query('SELECT COUNT(*) AS t...', [], false, true) in Query.phphtml line 248
  3. at Query->query('SELECT COUNT(*) AS t...', [], false, true) in Query.phphtml line 2423
  4. at Query->getPdo() in Query.phphtml line 434
  5. at Query->value('COUNT(*) AS tp_count', 0, true) in Query.phphtml line 540
  6. at Query->count() in News.phphtml line 18
  7. at News->news()
  8. at ReflectionMethod->invokeArgs(object(News), []) in App.phphtml line 343
  9. at App::invokeMethod([object(News), 'news'], []) in App.phphtml line 606
  10. at App::module(['index', 'news', 'news'], ['app_host' => '', 'app_debug' =>true, 'app_trace' =>false, ...], false) in App.phphtml line 456
  11. at App::exec(['type' => 'module', 'module' => ['index', 'news', 'news'], 'convert' =>false], ['app_host' => '', 'app_debug' =>true, 'app_trace' =>false, ...]) in App.phphtml line 139
  12. at App::run() in start.phphtml line 19
  13. at require('/www/wwwroot/www.dor...') in index.phphtml 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 'htm ) 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 'htm ) LIMIT 1' at line 1
Error SQL SELECT COUNT(*) AS tp_count FROM `news` WHERE ( cate_id =7871.htm ) LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database new_dorosin
hostport 3306
dsn
params []
charset utf8
prefix
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 false
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

USER
www
HOME
/home/www
HTTP_USER_AGENT
Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
HTTP_ACCEPT
*/*
HTTP_HOST
www.miguogg.com
PATH_INFO
/news/7871.htm
REDIRECT_STATUS
200
SERVER_NAME
www.miguogg.com
SERVER_PORT
80
SERVER_ADDR
172.16.79.59
REMOTE_PORT
44278
REMOTE_ADDR
156.226.191.106
SERVER_SOFTWARE
nginx/1.14.2
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/www.dorosinchina.com/public
DOCUMENT_URI
/index.phphtml
REQUEST_URI
/news/7871.htm
SCRIPT_NAME
/index.phphtml
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/news/7871.htm
SCRIPT_FILENAME
/www/wwwroot/www.dorosinchina.com/public/index.phphtml
FCGI_ROLE
RESPONDER
PHP_SELF
/index.phphtml
REQUEST_TIME_FLOAT
1579636732.0631
REQUEST_TIME
1579636732
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.dorosinchina.com/public/../application/
THINK_VERSION
5.0.20
THINK_START_TIME
1579636732.0632
THINK_START_MEM
356552
EXT
.phphtml
DS
/
THINK_PATH
/www/wwwroot/www.dorosinchina.com/thinkphp/
LIB_PATH
/www/wwwroot/www.dorosinchina.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.dorosinchina.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.dorosinchina.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.dorosinchina.com/
EXTEND_PATH
/www/wwwroot/www.dorosinchina.com/extend/
VENDOR_PATH
/www/wwwroot/www.dorosinchina.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.dorosinchina.com/runtime/
LOG_PATH
/www/wwwroot/www.dorosinchina.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.dorosinchina.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.dorosinchina.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.dorosinchina.com/public/../application/
CONF_EXT
.phphtml
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false