[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 ') 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 * FROM `z_cat...', [], false, false) in Query.php line 227
  3. at Query->query('SELECT * FROM `z_cat...', [], false, false) in Query.php line 2509
  4. at Query->find() in News.php line 71
  5. at News->view()
  6. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 343
  7. at App::invokeMethod([object(News), 'view'], []) in App.php line 599
  8. at App::module(['home', 'news', 'view'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  9. at App::exec(['type' => 'module', 'module' => ['home', 'news', 'view'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  10. at App::run() in start.php line 19
  11. at require('/www/wwwroot/sennael...') 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 ') 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 ') LIMIT 1' at line 1
Error SQL SELECT * FROM `z_category` WHERE ( category_id= ) LIMIT 1
Database Config
type mysql
hostname localhost
database sennaelevator
hostport
dsn
params []
charset utf8
prefix z_
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
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/sennaelevator.com/public/index.php
QUERY_STRING
s=/news/view/249.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/news/view/249.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/sennaelevator.com/public
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.18.0
REMOTE_ADDR
3.227.239.160
REMOTE_PORT
38262
SERVER_ADDR
172.21.104.158
SERVER_PORT
80
SERVER_NAME
sennaelevator.com
REDIRECT_STATUS
200
PATH_INFO
/news/view/249.html
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
www.sennaelevator.com
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711627712.1977
REQUEST_TIME
1711627712
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/sennaelevator.com/public/../apps/
THINK_VERSION
5.0.14
THINK_START_TIME
1711627712.1982
THINK_START_MEM
259432
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/sennaelevator.com/thinkphp/
LIB_PATH
/www/wwwroot/sennaelevator.com/thinkphp/library/
CORE_PATH
/www/wwwroot/sennaelevator.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/sennaelevator.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/sennaelevator.com/
EXTEND_PATH
/www/wwwroot/sennaelevator.com/extend/
VENDOR_PATH
/www/wwwroot/sennaelevator.com/vendor/
RUNTIME_PATH
/www/wwwroot/sennaelevator.com/runtime/
LOG_PATH
/www/wwwroot/sennaelevator.com/runtime/log/
CACHE_PATH
/www/wwwroot/sennaelevator.com/runtime/cache/
TEMP_PATH
/www/wwwroot/sennaelevator.com/runtime/temp/
CONF_PATH
/www/wwwroot/sennaelevator.com/public/../apps/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false