PHP和SQL自动插入日期和时间[重复]

This question already has an answer here:

I am trying to auto insert date and time into my SQL database when a form is submitted from a php page

$sql="INSERT INTO tracker_msisdn_trace (msisdn, avis_name, date, colour, driver, 
driver_id, notes)
VALUES 
('$_POST[msisdn]','$_POST[avis_name]','$_POST[date]','$_POST[colour]','$_POST[driver]','$_POST
[driver_id]','$_POST[notes]')";

This is the code I use for Manual inserting data.

To auto insert the day I have tried the following

 $date = date("Y-m-d") 
 $_POST[".$date."]

I am not getting the date and time inserted into the SQL it shows 0000-00-00

This is my SQL table

Name Type Collation Attributes Null Default Extra

4 date date No None

Assistance would be appreciated

</div>

You can do like this :

$date = date("Y-m-d") 
$_POST['date'] = $date

Otherway :

$sql="INSERT INTO tracker_msisdn_trace (msisdn, avis_name, date, colour, driver, 
driver_id, notes)
VALUES 
('$_POST[msisdn]','$_POST[avis_name]','". $date ."','$_POST[colour]','$_POST[driver]','$_POST
[driver_id]','$_POST[notes]')";