For some reason my date and time displays as a default instead of what the actual user has entered. I don't know what may be wrong. My data types in mySQL are as follows:
由于某种原因,我的日期和时间显示为默认值而不是实际用户输入的内容。我不知道可能出错了什么。 mySQL中的数据类型如下:
I tried changing the date and time to DATE
and TIME()
data types respectively. It doesn't let me...
我尝试分别将日期和时间更改为DATE和TIME()数据类型。它不让我......
I have the date and times output formated in my $insert
query as follows:
我在$ insert查询中格式化了日期和时间输出,如下所示:
$insert = "INSERT INTO Booking_request_form (treatment, date, time, message, client_fk)
VALUES('".date('Y/m/d',strtotime($_POST["Date"]))."', '".date('H:i',strtotime($_POST["Time"]))."', ...
Is there an east way to fix this ? Many Thanks
有没有东方方法来解决这个问题?非常感谢
1 个解决方案
#1
0
replace this:
替换这个:
date('Y/m/d',strtotime($_POST["Date"]))
with:
有:
date('Y-m-d',strtotime($_POST["Date"]))
#1
0
replace this:
替换这个:
date('Y/m/d',strtotime($_POST["Date"]))
with:
有:
date('Y-m-d',strtotime($_POST["Date"]))