form part Code
Omit **************************************
Echo ' '; echo "Please select "; foreach ($year as $value) {echo '$value "; } Echo 'Years ';
Omit ********************************************************
?>
Form Validation Section Code
Omit ************************************************
if ($_post[' year ']!= Please select &&$_post[' month ']!= Please select &&$_post[' Day ']!= please select)
$birthday =$_post[' year '].$_post[' month '].$_post[' Day ';
else Array_push ($errors, ' Please choose a birthday date ');
if (!empty ($_post[' introduct ')) $introduction =$_post[' introduct '];
Omit *************************************************
?>
Now the problem is that I want to save the $birthday to the database data type field, but the value passed in is always 0000-00-00, unless I change the data type to character type, just learn PHP, please help us
Reply to discussion (solution)
Save with time stamp and change the type of time to int type. The time to deposit in is as follows
$date =stetotime ($birthday);
Save with time stamp and change the type of time to int type. The time to deposit in is as follows
$date =stetotime ($birthday);
$date =strtotime ($birthday);
Wrong call.
$birthday =$_post[' year ']. ' -'. $_post[' month '. ' -'. $_post[' Day ';
@xuzuning, the original can also be so, than 1 floor simple ah, however, your method is also very good @xxoome, thank you for your help!!