[10501] PDOException in Connection.php line 451

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'city' cannot be null

  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 (\Exception $e) {
  11. if ($this->isBreak($e)) {
  12. return $this->close()->execute($sql, $bind);
  13. }
  14. throw $e;
  15. }
  16. }
  17. /**

Call Stack

  1. in Connection.php line 451
  2. at Connection->execute('INSERT INTO `da_visi...', ['__data__ip_address' => ['172.94.10.92', 2], '__data__add_time' => ['2019-03-17 17:30:21', 2]]) in Query.php line 239
  3. at Query->execute('INSERT INTO `da_visi...', ['__data__ip_address' => ['172.94.10.92', 2], '__data__add_time' => ['2019-03-17 17:30:21', 2]]) in Query.php line 2083
  4. at Query->insert(['ip_address' => '172.94.10.92', 'city' => null, 'add_time' => '2019-03-17 17:30:21'])
  5. at call_user_func_array([object(Query), 'insert'], [['ip_address' => '172.94.10.92', 'city' => null, 'add_time' => '2019-03-17 17:30:21']]) in Model.php line 2061
  6. at Model::__callStatic('insert', [['ip_address' => '172.94.10.92', 'city' => null, 'add_time' => '2019-03-17 17:30:21']]) in CommonController.php line 173
  7. at Visit::insert(['ip_address' => '172.94.10.92', 'city' => null, 'add_time' => '2019-03-17 17:30:21']) in CommonController.php line 173
  8. at CommonController->_initialize() in Controller.php line 56
  9. at Controller->__construct(object(Request))
  10. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 215
  11. at App::invokeClass('app\index\controller...') in Loader.php line 420
  12. at Loader::controller('index', 'controller', true, 'Error') in App.php line 391
  13. at App::module(['index', 'index', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 295
  14. at App::exec(['type' => 'module', 'module' => ['index', 'index', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 123
  15. at App::run() in start.php line 18
  16. at require('/www/wwwroot/www.qud...') in index.php line 17

Exception Datas

PDO Error Info
SQLSTATE 23000
Driver Error Code 1048
Driver Error Message Column 'city' cannot be null
Database Status
Error Code 10501
Error Message SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'city' cannot be null
Error SQL INSERT INTO `da_visit` (`ip_address` , `city` , `add_time`) VALUES ('172.94.10.92' , NULL , '2019-03-17 17:30:21')
Database Config
type mysql
hostname 127.0.0.1
database qudai8
hostport 3306
dsn
params []
charset utf8
prefix da_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
fields_strict true
result_type 2
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

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

UM_distinctid
1698a22366177-0fdba464bba7f6-9333061-1fa400-1698a2236622eb
PHPSESSID
1s3dfu2tsqanilo7b48mg4hru3

Session

think
{ "webcityConfig": { "webcity_id": 0, "province_id": 0, "city_id": 0, "city_name": "\u5168\u56fd" } }

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/www.qudai8.com/public/index.php
QUERY_STRING
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/www.qudai8.com/public
SERVER_PROTOCOL
HTTP/2.0
REQUEST_SCHEME
https
HTTPS
on
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.12.1
REMOTE_ADDR
172.94.10.92
REMOTE_PORT
59450
SERVER_ADDR
122.114.9.25
SERVER_PORT
443
SERVER_NAME
www.qudai8.com
REDIRECT_STATUS
200
PATH_INFO
HTTP_HOST
www.qudai8.com
HTTP_UPGRADE_INSECURE_REQUESTS
1
HTTP_USER_AGENT
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
HTTP_ACCEPT
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_ACCEPT_ENCODING
gzip, deflate, br
HTTP_ACCEPT_LANGUAGE
zh-CN,zh;q=0.9
HTTP_COOKIE
UM_distinctid=1698a22366177-0fdba464bba7f6-9333061-1fa400-1698a2236622eb; PHPSESSID=1s3dfu2tsqanilo7b48mg4hru3
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1552815020.8264
REQUEST_TIME
1552815020
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.qudai8.com/public/../application/
THINK_VERSION
5.0.10
THINK_START_TIME
1552815020.8271
THINK_START_MEM
264088
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.qudai8.com/thinkphp/
LIB_PATH
/www/wwwroot/www.qudai8.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.qudai8.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.qudai8.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.qudai8.com/
EXTEND_PATH
/www/wwwroot/www.qudai8.com/extend/
VENDOR_PATH
/www/wwwroot/www.qudai8.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.qudai8.com/runtime/
LOG_PATH
/www/wwwroot/www.qudai8.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.qudai8.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.qudai8.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.qudai8.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
Safe360
/www/wwwroot/www.qudai8.com/thinkphp