Wrote a query $query= mysqli_query($connect,"INSERT INTO Users (AcceptEmail) VALUES ('$acceptEmail')") , but for some reason affects other tables and an error is generated

 Field 'login' doesn't have a default value 

This is my first field.

  • one
    they tell you that the users table has a login field, it cannot be empty and does not have a default value, therefore, when inserting a new line, you must specify and the value of this field is teran
  • @teran as I understand it, overwrites all values. And how can I add it in the database? - Pavel Kushnerevich
  • what does "overwrite" mean? it does not overwrite anything, it also adds a new entry. And any record consists of all fields, it cannot consist only of a part of fields. Another thing is that the fields for which NULL is allowed or default values ​​are given when insert can be omitted, then they will accept these default values. But all the fields that are declared as required - fill out, oddly enough, be sure to - Mike
  • @Mike they are filled with me to this part of the code, just now I need to rewrite the field from 0 to 1 - Pavel Kushnerevich
  • 2
    But you write INSERT - it inserts a new record , UPDATE exists for modifying an existing record. just do not forget to tell him exactly which record you want to update (in the where part), otherwise it will update everything - Mike

0