[10501] PDOException in Connection.php line 687

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 'and ty= and status=1 and id>58 ) ORDER BY `disorder` ASC,`id` ASC LIMIT 1' at line 1

  1. $this->debug(false, '', $master);
  2. // 返回结果集
  3. return $this->getResult($pdo, $procedure);
  4. } catch (\PDOException $e) {
  5. if ($this->isBreak($e)) {
  6. return $this->close()->query($sql, $bind, $master, $pdo);
  7. }
  8. throw new PDOException($e, $this->config, $this->getLastsql());
  9. } catch (\Throwable $e) {
  10. if ($this->isBreak($e)) {
  11. return $this->close()->query($sql, $bind, $master, $pdo);
  12. }
  13. throw $e;
  14. } catch (\Exception $e) {
  15. if ($this->isBreak($e)) {
  16. return $this->close()->query($sql, $bind, $master, $pdo);

Call Stack

  1. in Connection.php line 687
  2. at Connection->query('SELECT `id`,`title` ...', [], false, false) in Connection.php line 923
  3. at Connection->select(object(Query)) in Query.php line 3028
  4. at Query->select() in common.php line 453
  5. at get_prev('58') in 84d404b06c5889c62355d603e1aa1d55.php line 201
  6. at include('/home/wwwroot/chinai...') in File.php line 59
  7. at File->read('/home/wwwroot/chinai...', []) in Template.php line 226
  8. at Template->fetch('application/index/vi...', [], []) in Think.php line 93
  9. at Think->fetch('', [], []) in View.php line 192
  10. at View->fetch('', [], [], false) in View.php line 42
  11. at View->output('') in Response.php line 396
  12. at Response->getContent() in Response.php line 128
  13. at Response->send() in index.php line 21

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 'and ty= and status=1 and id>58 ) ORDER BY `disorder` ASC,`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 'and ty= and status=1 and id>58 ) ORDER BY `disorder` ASC,`id` ASC LIMIT 1' at line 1
Error SQL SELECT `id`,`title` FROM `tp_news` WHERE ( pid= and ty= and status=1 and id>58 ) ORDER BY `disorder` ASC,`id` ASC LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database zhonke
hostport 3306
dsn
params []
charset utf8
prefix tp_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict false
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
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
REDIRECT_STATUS 200
proxy-nokeepalive 1
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST iotchinadragon.com
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH /www/server/apache/lib
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
SERVER_NAME iotchinadragon.com
SERVER_ADDR 211.149.171.80
SERVER_PORT 80
REMOTE_ADDR 54.198.37.250
DOCUMENT_ROOT /www/wwwroot/chinaidps.com2
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /www/wwwroot/chinaidps.com2
SERVER_ADMIN webmaster@example.com
SCRIPT_FILENAME /www/wwwroot/chinaidps.com2/index.php
REMOTE_PORT 36890
REDIRECT_URL /show-id-58.html
REDIRECT_QUERY_STRING s=index/lists/show-id-58
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING s=index/lists/show-id-58
REQUEST_URI /show-id-58.html
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711669375.3849
REQUEST_TIME 1711669375
Environment Variablesempty
ThinkPHP Constantsempty