[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 '< n_id ) ORDER BY n_id asc 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 (\Exception $e) {
  12. if ($this->isBreak($e)) {
  13. return $this->close()->query($sql, $bind, $master, $pdo);
  14. }
  15. throw $e;
  16. }
  17. }
  18. /**

Call Stack

  1. in Connection.php line 388
  2. at Connection->query('SELECT * FROM `tyj_n...', [], false, false) in Query.php line 225
  3. at Query->query('SELECT * FROM `tyj_n...', [], false, false) in Query.php line 2475
  4. at Query->find() in News.php line 50
  5. at News->pageAdd()
  6. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 196
  7. at App::invokeMethod([object(News), 'pageadd'], []) in App.php line 408
  8. at App::module(['home', 'news', 'pageadd'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 295
  9. at App::exec(['type' => 'module', 'module' => ['home', 'news', 'pageadd']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 123
  10. at App::run() in start.php line 18
  11. at require('/www/wwwroot/gaode/t...') in index.php line 19

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 '< n_id ) ORDER BY n_id asc 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 '< n_id ) ORDER BY n_id asc LIMIT 1' at line 1
Error SQL SELECT * FROM `tyj_news` `a` INNER JOIN `tyj_menu` `b` ON `a`.`news_columnid`=`b`.`id` WHERE `news_columnid` = null AND ( < n_id ) ORDER BY n_id asc LIMIT 1
Database Config
type mysql
hostname localhost
database gaode
hostport 3306
dsn
params []
charset utf8
prefix tyj_
debug false
deploy 0
rw_separate false
master_num 1
slave_no
fields_strict true
result_type 2
resultset_type array
auto_timestamp false
datetime_format false
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/gaode/index.php
QUERY_STRING
s=/home/news/pageadd.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/home/news/pageadd.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/gaode
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.20.2
REMOTE_ADDR
54.159.116.24
REMOTE_PORT
41072
SERVER_ADDR
172.16.125.201
SERVER_PORT
80
SERVER_NAME
gaodekeji.com
REDIRECT_STATUS
200
PATH_INFO
/home/news/pageadd.html
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
www.gaodekeji.com
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711712994.5401
REQUEST_TIME
1711712994
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/gaode/app/
RUNTIME_PATH
/www/wwwroot/gaode/data/runtime/
THINK_VERSION
5.0.10
THINK_START_TIME
1711712994.5406
THINK_START_MEM
259528
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/gaode/thinkphp/
LIB_PATH
/www/wwwroot/gaode/thinkphp/library/
CORE_PATH
/www/wwwroot/gaode/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/gaode/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/gaode/
EXTEND_PATH
/www/wwwroot/gaode/extend/
VENDOR_PATH
/www/wwwroot/gaode/vendor/
LOG_PATH
/www/wwwroot/gaode/data/runtime/log/
CACHE_PATH
/www/wwwroot/gaode/data/runtime/cache/
TEMP_PATH
/www/wwwroot/gaode/data/runtime/temp/
CONF_PATH
/www/wwwroot/gaode/app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
QINIU_FUNCTIONS_VERSION
7.2.0
ADDON_PATH
/www/wwwroot/gaode/addons/
__ROOT__
MODULE_NAME
home
CONTROLLER_NAME
News
ACTION_NAME
pageadd