[10501] PDOException in Connection.php line 675

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 `class1` = AND `class2` = ORDER BY id ASC LIMIT 1' at line 1

  1. $this->debug(false);
  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 675
  2. at Connection->query('SELECT * FROM `met_p...', [], false, false) in Connection.php line 834
  3. at Connection->find(object(Query)) in Query.php line 2597
  4. at Query->find() in Teacher.php line 113
  5. at Teacher->getPrev(null) in Teacher.php line 91
  6. at Teacher->show()
  7. at ReflectionMethod->invokeArgs(object(Teacher), []) in Container.php line 214
  8. at Container->invokeMethod([object(Teacher), 'show'], ['id' => '974']) in Module.php line 126
  9. at Module->run() in Url.php line 26
  10. at Url->run() in App.php line 362
  11. at App->run() in index.php line 14

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 `class1` = AND `class2` = ORDER BY 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 `class1` = AND `class2` = ORDER BY id ASC LIMIT 1' at line 1
Error SQL SELECT * FROM `met_product` WHERE `id` > AND `class1` = AND `class2` = ORDER BY id ASC LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database qkwr_net
hostport
dsn
params []
charset utf8
prefix met_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
fields_strict true
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
read_master false
break_match_str []

Environment Variables

GET Data
id 974
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
SCRIPT_NAME /index.php
REQUEST_URI /index/teacher/show.html?id=974
QUERY_STRING s=/index/teacher/show.html&id=974
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_QUERY_STRING s=/index/teacher/show.html&id=974
REDIRECT_URL /index/teacher/show.html
REMOTE_PORT 53954
SCRIPT_FILENAME /www/wwwroot/qkwr.net/index.php
SERVER_ADMIN webmaster@example.com
CONTEXT_DOCUMENT_ROOT /www/wwwroot/qkwr.net/
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT /www/wwwroot/qkwr.net/
REMOTE_ADDR 44.204.218.79
SERVER_PORT 80
SERVER_ADDR 122.114.55.51
SERVER_NAME www.qkwr.net
SERVER_SOFTWARE Apache
SERVER_SIGNATURE <address>Apache Server at www.qkwr.net Port 80</address>
LD_LIBRARY_PATH /www/server/apache/lib
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOST www.qkwr.net
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
proxy-nokeepalive 1
REDIRECT_STATUS 200
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711653887.2305
REQUEST_TIME 1711653887
PATH_INFO /index/teacher/show.html
Environment Variablesempty
ThinkPHP Constants
APP_PATH /home/wwwroot/qkwr.net/application/
THINK_VERSION 5.0.24
THINK_START_TIME 1711653887.2323
THINK_START_MEM 433808
EXT .php
DS /
THINK_PATH /home/wwwroot/qkwr.net/thinkphp/
LIB_PATH /home/wwwroot/qkwr.net/thinkphp/library/
CORE_PATH /home/wwwroot/qkwr.net/thinkphp/library/think/
TRAIT_PATH /home/wwwroot/qkwr.net/thinkphp/library/traits/
ROOT_PATH /home/wwwroot/qkwr.net/
EXTEND_PATH /home/wwwroot/qkwr.net/extend/
VENDOR_PATH /home/wwwroot/qkwr.net/vendor/
RUNTIME_PATH /home/wwwroot/qkwr.net/runtime/
LOG_PATH /home/wwwroot/qkwr.net/runtime/log/
CACHE_PATH /home/wwwroot/qkwr.net/runtime/cache/
TEMP_PATH /home/wwwroot/qkwr.net/runtime/temp/
CONF_PATH /home/wwwroot/qkwr.net/application/
CONF_EXT .php
ENV_PREFIX PHP_