[10501] PDOException in Connection.php line 456

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

  1. // 调试结束
  2. $this->debug(false);
  3. $this->numRows = $this->PDOStatement->rowCount();
  4. return $this->numRows;
  5. } catch (\PDOException $e) {
  6. if ($this->isBreak($e)) {
  7. return $this->close()->execute($sql, $bind);
  8. }
  9. throw new PDOException($e, $this->config, $this->getLastsql());
  10. } catch (\Throwable $e) {
  11. if ($this->isBreak($e)) {
  12. return $this->close()->execute($sql, $bind);
  13. }
  14. throw $e;
  15. } catch (\Exception $e) {
  16. if ($this->isBreak($e)) {
  17. return $this->close()->execute($sql, $bind);
  18. }

Call Stack

  1. in Connection.php line 456
  2. at Connection->execute('INSERT INTO `mazda_c...', ['data__reading' => [1, 1], 'data__cid' => [698, 1]]) in Query.php line 241
  3. at Query->execute('INSERT INTO `mazda_c...', ['data__reading' => [1, 1], 'data__cid' => [698, 1]]) in Query.php line 2094
  4. at Query->insert(['reading' => 1, 'cid' => 698]) in Index.php line 2546
  5. at Index->news_detail('1718', '52')
  6. at ReflectionMethod->invokeArgs(object(Index), ['1718', '52']) in App.php line 343
  7. at App::invokeMethod([object(Index), 'news_detail'], []) in App.php line 595
  8. at App::module(['hgs', 'index', 'news_detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 457
  9. at App::exec(['type' => 'module', 'module' => ['hgs', 'index', 'news_detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  10. at App::run() in start.php line 19
  11. at require('/www/wwwroot/ceshi.z...') in index.php line 34

Exception Datas

PDO Error Info
SQLSTATE 23000
Driver Error Code 1062
Driver Error Message Duplicate entry '0' for key 'PRIMARY'
Database Status
Error Code 10501
Error Message SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
Error SQL INSERT INTO `mazda_cms_document_licai` (`reading` , `cid`) VALUES (1 , 698)
Database Config
type mysql
hostname rm-2zeiks3qcu425awdh.mysql.rds.aliyuncs.com
database zx-trust
hostport 3306
dsn
params []
charset utf8
prefix mazda_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
fields_strict false
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/ceshi.zx-trust.com/public/index.php
QUERY_STRING
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/public/index.php
REQUEST_URI
/index/news_detail/id/1718/cid/52
DOCUMENT_URI
/public/index.php/hgs/index/news_detail/id/1718/cid/52
DOCUMENT_ROOT
/www/wwwroot/ceshi.zx-trust.com
SERVER_PROTOCOL
HTTP/2.0
REQUEST_SCHEME
https
HTTPS
on
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.18.0
REMOTE_ADDR
3.238.79.169
REMOTE_PORT
41208
SERVER_ADDR
172.17.132.59
SERVER_PORT
443
SERVER_NAME
www.zx-trust.com
REDIRECT_STATUS
200
PATH_INFO
/hgs/index/news_detail/id/1718/cid/52
HTTP_HOST
zx-trust.com
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
PHP_SELF
/public/index.php/hgs/index/news_detail/id/1718/cid/52
REQUEST_TIME_FLOAT
1711615247.1537
REQUEST_TIME
1711615247
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/ceshi.zx-trust.com/public/../application/
ADMIN_FILE
admin.php
THINK_VERSION
5.0.15
THINK_START_TIME
1711615247.1541
THINK_START_MEM
235096
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/ceshi.zx-trust.com/thinkphp/
LIB_PATH
/www/wwwroot/ceshi.zx-trust.com/thinkphp/library/
CORE_PATH
/www/wwwroot/ceshi.zx-trust.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/ceshi.zx-trust.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/ceshi.zx-trust.com/
EXTEND_PATH
/www/wwwroot/ceshi.zx-trust.com/extend/
VENDOR_PATH
/www/wwwroot/ceshi.zx-trust.com/vendor/
RUNTIME_PATH
/www/wwwroot/ceshi.zx-trust.com/runtime/
LOG_PATH
/www/wwwroot/ceshi.zx-trust.com/runtime/log/
CACHE_PATH
/www/wwwroot/ceshi.zx-trust.com/runtime/cache/
TEMP_PATH
/www/wwwroot/ceshi.zx-trust.com/runtime/temp/
CONF_PATH
/www/wwwroot/ceshi.zx-trust.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/www/wwwroot/ceshi.zx-trust.com/vendor/ezyang/htmlpurifier/library
PUBLIC_PATH
/public/