[10501] PDOException in Connection.php line 357

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 ') ORDER BY id desc LIMIT 1' 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 357
  2. at Connection->query('SELECT `id`,`title` ...', [], false, false) in Query.php line 195
  3. at Query->query('SELECT `id`,`title` ...', [], false, false) in Query.php line 1976
  4. at Query->find() in Detail.php line 15
  5. at Detail->index('350')
  6. at ReflectionMethod->invokeArgs(object(Detail), ['350']) in App.php line 226
  7. at App::invokeMethod([object(Detail), 'index']) in App.php line 359
  8. at App::module([null, 'detail', 'index'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 134
  9. at App::run() in start.php line 18
  10. at require('/www/wwwroot/esp1236...') in index.php line 16

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 ') ORDER BY id desc 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 ') ORDER BY id desc LIMIT 1' at line 1
Error SQL SELECT `id`,`title` FROM `yl_article` WHERE ( id < 350 and ischecked=1 and isdelete=0 and cid= ) ORDER BY id desc LIMIT 1
Database Config
type mysql
hostname localhost
database esp12366_com
username esp12366_com
password mTeCsPdpsGnhmtwh
hostport 3306
dsn
params []
charset utf8
prefix yl_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
fields_strict true
resultset_type array
auto_timestamp false
sql_explain false
builder

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER http://www.esp12366.com/detail/350.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.esp12366.com
PATH_INFO /detail/350.html
REDIRECT_STATUS 200
SERVER_NAME esp12366.com
SERVER_PORT 443
SERVER_ADDR 148.135.30.189
REMOTE_PORT 37810
REMOTE_ADDR 44.221.43.88
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/esp12366.com/public_html
DOCUMENT_URI /index.php
REQUEST_URI /detail/350.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/detail/350.html
SCRIPT_FILENAME /www/wwwroot/esp12366.com/public_html/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711619966.6952
REQUEST_TIME 1711619966
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/esp12366.com/public_html/../application/
THINK_VERSION 5.0.0
THINK_START_TIME 1711619966.6972
THINK_START_MEM 367312
EXT .php
DS /
THINK_PATH /www/wwwroot/esp12366.com/thinkphp/
LIB_PATH /www/wwwroot/esp12366.com/thinkphp/library/
CORE_PATH /www/wwwroot/esp12366.com/thinkphp/library/think/
TRAIT_PATH /www/wwwroot/esp12366.com/thinkphp/library/traits/
ROOT_PATH /www/wwwroot/esp12366.com/public_html/../
EXTEND_PATH /www/wwwroot/esp12366.com/public_html/../extend/
VENDOR_PATH /www/wwwroot/esp12366.com/public_html/../vendor/
RUNTIME_PATH /www/wwwroot/esp12366.com/public_html/../runtime/
LOG_PATH /www/wwwroot/esp12366.com/public_html/../runtime/log/
CACHE_PATH /www/wwwroot/esp12366.com/public_html/../runtime/cache/
TEMP_PATH /www/wwwroot/esp12366.com/public_html/../runtime/temp/
CONF_PATH /www/wwwroot/esp12366.com/public_html/../application/
CONF_EXT .php
ENV_PREFIX PHP_
IS_CLI false
IS_WIN false