$date = $_POST['date']; mysql_query("INSERT INTO student(date) VALUES('$date')"); 

php http://savepic.net/8830189.png

  • one
    and what do you have in $ _POST ['date'] - L. Vadim
  • <div class = "row"> <label for = "date"> Date of birth: </ label> <input type = "date" name = "date" value = "1960-01-01" max = "2100-12 -31 "min =" 1960-01-01 "> </ div> - As Lan
  • If you create a separate table and send a request there, then it is sent, And here for some reason it did not, checked the names, everything is correct - As Lan
  • can you put all your script? - L. Vadim
  • Sorry, I've already fixed everything, there was some kind of bug or not) I decided to re-create the table) ATP - As Lan

1 answer 1

You have no default values ​​for all columns in the student table and are not allowed NULL . Therefore, there are three options:

  1. Set the default value for the columns.
  2. Allow NULL for columns.
  3. For INSERT specify all fields, not just date .