matrixindicator
IS-IT--Management
I have a formfield where I insert a date 2009-12-23, the day of today. The user can if he want change the date manually in the field. He submit this data and it should be inserted in the database.
For the date he insert nothing 0000-00-00 I checked the value of the form filed passed and its ok. I suppose it has to do something with data type ? In the test I set NOW() functionin the insert sql, this works. Is strtotime function usefull ?
For the date he insert nothing 0000-00-00 I checked the value of the form filed passed and its ok. I suppose it has to do something with data type ? In the test I set NOW() functionin the insert sql, this works. Is strtotime function usefull ?
Code:
$today = $_POST['fdatum'];
$todayinsert = strtotime('Y-m-d', $today);
echo $todayinsert;