Home  >  Q&A  >  body text

Preliminary implementation of user registration function

error: 1364 Field 'status' doesn't have a default value

I reported this error. You must add a default value to the status field in the zh_user table of the database before it can be added successfully. However, I found that the teacher's class did not add the default value, and it was added successfully. Why is this?

mama1902 days ago1203

reply all(2)I'll reply

  • ma

    ma2019-07-10 08:29:33

    But it's not written in your code. Why is the insertion successful?

    reply
    0
  • Reliable°

    Reliable°2019-07-09 20:54:17

    The database does not have a default value set. You can add a default value when inserting into the database.

    reply
    0
  • Cancelreply