[10501] PDOException in Connection.php line 388

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 'a.showstu=1 ) LIMIT 1' at line 1

  1. $this->PDOStatement->execute();
  2. // 调试结束
  3. $this->debug(false);
  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 388
  2. at Connection->query('SELECT COUNT(*) AS t...', [], false, true) in Query.php line 227
  3. at Query->query('SELECT COUNT(*) AS t...', [], false, true) in Query.php line 2292
  4. at Query->getPdo() in Query.php line 413
  5. at Query->value('COUNT(*) AS tp_count', 0, true) in Query.php line 519
  6. at Query->count() in Show.php line 165
  7. at Show->showtag('')
  8. at ReflectionMethod->invokeArgs(object(Show), ['']) in App.php line 343
  9. at App::invokeMethod([object(Show), 'showtag'], []) in App.php line 595
  10. at App::module(['index', 'show', 'showtag'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  11. at App::exec(['type' => 'module', 'module' => ['index', 'show', 'showtag'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  12. at App::run() in start.php line 19
  13. at require('/home/aiqin/thinkphp...') in index.php 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 'a.showstu=1 ) 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 'a.showstu=1 ) LIMIT 1' at line 1
Error SQL
SELECT COUNT(*) AS tp_count FROM v9_news a WHERE ( 1and a.showstu=1 ) LIMIT 1
Database Config
type
mysql
hostname
127.0.0.1
database
aiqin
hostport
dsn
params
[]
charset
utf8
prefix
v9_
debug
true
deploy
0
rw_separate
false
master_num
1
slave_no
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

/tags--1_html
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/tags--1.html
QUERY_STRING
/tags--1.html
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
/tags--1.html
REDIRECT_URL
/tags--1.html
REMOTE_PORT
20001
SCRIPT_FILENAME
/home/aiqin/public/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/home/aiqin/public
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
/home/aiqin/public
REMOTE_ADDR
175.29.12.93
SERVER_PORT
80
SERVER_ADDR
192.168.0.224
SERVER_NAME
www.aiqin.com
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
<address>Apache Server at www.aiqin.com Port 80</address>
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/www/server/panel/pyenv/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.aiqin.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
proxy-nokeepalive
1
REDIRECT_STATUS
200
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1606268904.4674
REQUEST_TIME
1606268904
PATH_INFO
/tags--1.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/aiqin/public/../application/
THINK_VERSION
5.0.13
THINK_START_TIME
1606268904.4678
THINK_START_MEM
366704
EXT
.php
DS
/
THINK_PATH
/home/aiqin/thinkphp/
LIB_PATH
/home/aiqin/thinkphp/library/
CORE_PATH
/home/aiqin/thinkphp/library/think/
TRAIT_PATH
/home/aiqin/thinkphp/library/traits/
ROOT_PATH
/home/aiqin/
EXTEND_PATH
/home/aiqin/extend/
VENDOR_PATH
/home/aiqin/vendor/
RUNTIME_PATH
/home/aiqin/runtime/
LOG_PATH
/home/aiqin/runtime/log/
CACHE_PATH
/home/aiqin/runtime/cache/
TEMP_PATH
/home/aiqin/runtime/temp/
CONF_PATH
/home/aiqin/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false