Set value to NULL in MySQL

前端 未结 9 1354
逝去的感伤
逝去的感伤 2020-11-30 01:17

I want a value to be set to NULL if nothing is put into the text box in the form I\'m submitting. How can I make this happen? I\'ve tried inserting \'NULL

9条回答
  •  死守一世寂寞
    2020-11-30 01:55

    Don't put NULL inside quotes in your update statement. This should work:

    UPDATE table SET field = NULL WHERE something = something
    

提交回复
热议问题