[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 '-10,10' 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 `article_id`,...', ['where_AND_site_id' => [498, 1], 'where_AND_class' => [7, 1]], false, false) in Query.php line 255
  3. at Query->query('SELECT `article_id`,...', ['where_AND_site_id' => [498, 1], 'where_AND_class' => [7, 1]], false, false) in Query.php line 2523
  4. at Query->select() in common.php line 688
  5. at get_article_list('cn', 498, ['site_id' => 498, 'class' => 'entertainment'], 'update_time desc', '10', '-10') in df20269c6186e513ca1d15374e2c91b4.php line 79
  6. at include('/www/wwwroot/zhanqun...') in File.php line 53
  7. at File->read('/www/wwwroot/zhanqun...', ['err_img' => '/static/images/err_i...', 'font_family' => '', 'translate' => [], ...]) in Template.php line 188
  8. at Template->fetch('./template/default1/...', ['err_img' => '/static/images/err_i...', 'font_family' => '', 'translate' => [], ...], []) in Think.php line 86
  9. at Think->fetch('./template/default1/...', ['err_img' => '/static/images/err_i...', 'font_family' => '', 'translate' => [], ...], []) in View.php line 163
  10. at View->fetch('./template/default1/...', [], [], []) in Controller.php line 120
  11. at Controller->fetch('./template/default1/...') in Base.php line 75
  12. at Base->tpl('cn_list.html') in Index.php line 34
  13. at Index->index() in Index.php line 78
  14. at Index->view()
  15. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 343
  16. at App::invokeMethod([object(Index), 'view'], []) in App.php line 633
  17. at App::module(['entertainment', 'list_0', null], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 457
  18. at App::exec(['type' => 'module', 'module' => ['entertainment', 'list_0', null]], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  19. at App::run() in start.php line 19
  20. at require('/www/wwwroot/zhanqun...') 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 '-10,10' 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 '-10,10' at line 1
Error SQL SELECT `article_id`,`class`,`flag`,`title`,`thumb`,`update_time` FROM `dd_article_1000` WHERE `site_id` = 498 AND `class` = 7 ORDER BY `update_time` DESC LIMIT -10,10
Database Config
type mysql
hostname 127.0.0.1
database zhanqun
hostport 3306
dsn
params []
charset utf8
prefix dd_
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
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/zhanqun.com/public/index.php
QUERY_STRING
s=/entertainment/list_0.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/entertainment/list_0.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/zhanqun.com/public
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.22.1
REMOTE_ADDR
44.204.24.82
REMOTE_PORT
33104
SERVER_ADDR
10.0.8.2
SERVER_PORT
80
SERVER_NAME
www.zwtxnews.xyz
REDIRECT_STATUS
200
PATH_INFO
/entertainment/list_0.html
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
yorkfashion.cn
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711646882.1721
REQUEST_TIME
1711646882
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/zhanqun.com/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711646882.1724
THINK_START_MEM
233224
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/zhanqun.com/thinkphp/
LIB_PATH
/www/wwwroot/zhanqun.com/thinkphp/library/
CORE_PATH
/www/wwwroot/zhanqun.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/zhanqun.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/zhanqun.com/
EXTEND_PATH
/www/wwwroot/zhanqun.com/extend/
VENDOR_PATH
/www/wwwroot/zhanqun.com/vendor/
RUNTIME_PATH
/www/wwwroot/zhanqun.com/runtime/
LOG_PATH
/www/wwwroot/zhanqun.com/runtime/log/
CACHE_PATH
/www/wwwroot/zhanqun.com/runtime/cache/
TEMP_PATH
/www/wwwroot/zhanqun.com/runtime/temp/
CONF_PATH
/www/wwwroot/zhanqun.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
IN_SYS
true
SITEID
498
SITENAME
yorkfashion.cn
TEMPLATE
default1
LANGUAGE
cn
COPYRIGHT