我有datepicker
<input class='form-control formBlock datepick' name='period_startdate' value='' type='text' placeholder="Enter First Work Date..." required>
datepicker脚本
<script>
$('.datepick').each(function(){
$(this).datepicker();
});
</script>
sql语句
[other variables...]
//datepicker variable
$period_startdate=$_POST['period_startdate'];
$insertpayperiod= $db->prepare("INSERT INTO payroll (pay_name,pay_group,payday,gross_paycheck,payrate,annual_gross_income,pay_slip_type,pay_rate_unit,total_weekly_hours,total_yearly_hours,created_byid) VALUES (?,?,?,?,?,?,?,?,?,?,?)");
$insertpayperiod->bind_param("siiiiissiii",$pay_name,$paygroup,$payday,$gross_paycheck,$payrate,$annual_gross_income,$paysliptype,$payrateunit,$total_weekly_hours,$total_yearly_hours,$createdbyid);
MysQl日期格式
0000-00-00
如何将其转换为mysql日期并进行插入?我做了笔记here。我确实读过manual。但是,虽然我在某种程度上理解这个概念,但我无法动态地动态地:-/