[10501] PDOException in Connection.php line 764

SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value

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

Call Stack

  1. in Connection.php line 764
  2. at Connection->execute('INSERT INTO `blocker...', ['ThinkBind_1_' => [0, 1], 'ThinkBind_2_' => ['http://choice.agnes-...', 2], 'ThinkBind_3_' => ['3.139.107.241', 2], ...], object(Query)) in Connection.php line 964
  3. at Connection->insert(object(Query), false, false, null) in Query.php line 2835
  4. at Query->insert(['status' => 0, 'refer' => 'http://choice.agnes-...', 'ip_address' => '3.139.107.241', ...], false, false, null) in Model.php line 674
  5. at Model->insertData(null) in Model.php line 469
  6. at Model->save() in Blocker.php line 61
  7. at Blocker::logAccess('3.139.107.241', 'http://choice.agnes-...', 'normal:0') in BaseController.php line 54
  8. at BaseController->__construct(object(App))
  9. at ReflectionClass->newInstanceArgs([object(App)]) in Container.php line 439
  10. at Container->invokeClass('app\ao_choice\contro...', []) in Container.php line 284
  11. at Container->make('app\ao_choice\contro...', []) in App.php line 725
  12. at App->controller('index', 'controller', false, 'Error') in Module.php line 95
  13. at Module->exec() in Dispatch.php line 168
  14. at Dispatch->run() in App.php line 432
  15. at App->think\{closure}(object(Request), object(Closure), null)
  16. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  17. at Middleware->think\{closure}(object(Request)) in CrossDomain.php line 19
  18. at CrossDomain->handle(object(Request), object(Closure), null)
  19. at call_user_func_array([object(CrossDomain), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 185
  20. at Middleware->think\{closure}(object(Request))
  21. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  22. at Middleware->dispatch(object(Request)) in App.php line 435
  23. at App->run() in index.php line 21

Exception Datas

PDO Error Info
SQLSTATE HY000
Driver Error Code 1364
Driver Error Message Field 'id' doesn't have a default value
Database Status
Error Code 10501
Error Message SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value
Error SQL INSERT INTO `blocker` (`status` , `refer` , `ip_address` , `remark` , `createdOn`) VALUES (0 , 'http://choice.agnes-orinda.com/' , '3.139.107.241' , 'normal:0' , '2024-04-18 12:21:26')
Database Config
type mysql
hostname 127.0.0.1
database agnes_orinda_choice
hostport 3306
dsn
params []
charset utf8
prefix
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
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
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Session
think { "rs": "http:\/\/choice.agnes-orinda.com\/", "isInviter": 0 }
Server/Request Data
USER www
HOME /home/www
HTTP_HOST choice.agnes-orinda.com
HTTP_REFERER http://choice.agnes-orinda.com/
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
HOST choice.agnes-orinda.com
ARGS
SCHEME https
URI /index.php
SERVER_NAME choice.agnes-orinda.com
SERVER_PORT 443
SERVER_ADDR 176.9.10.234
REMOTE_PORT 57778
REMOTE_ADDR 3.139.107.241
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /export/www/allegrak_choice_new/allegrak_choice_tp/public/
DOCUMENT_URI /index.php
REQUEST_URI /
SCRIPT_NAME /index.php
SCRIPT_FILENAME /export/www/allegrak_choice_new/allegrak_choice_tp/public//index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SERVER_SOFTWARE nginx
GATEWAY_INTERFACE CGI/1.1
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1713457286.19
REQUEST_TIME 1713457286
Environment Variablesempty
ThinkPHP Constantsempty