Integrity constraint violation: 1048 Column 'name' cannot be null error

前端 未结 3 1477
借酒劲吻你
借酒劲吻你 2021-01-14 22:05

there were a lot of answers related to this, but I couldn\'t find useful information. I\'m trying to connect to the database and insert user\'s entered values into it, but I

3条回答
  •  青春惊慌失措
    2021-01-14 22:38

    It could be any problem related to the field. Check the HTML for spelling, confusion between name and value, etc. Your field may be empty because it is not finding the value you actually entered in the field because there is no such field per code (only on your screen). In my case, I had

    $new_user = array( "id" => $_POST ['id'], "fname" => $_POST['firstname']

    But the HTML was using fname and fname for both value and name.

    And there was the first error: name="firstname" was written as vname="firstname" Then the confusion with name and HTML value.

    You didn't post your HTML. The error is perhaps there.

提交回复
热议问题