这是我正在运行的php代码。在我的服务器中,我设置了一个时间变量来获取时间。
$time = date('H:i:s A', time());
$query = "INSERT INTO shouts (user, message, time)
VALUES('$user', '$message', '$time')";
if(!mysqli_query($con, $query)){
die('Error: ' .mysqli_error($con));
}else{
header("Location: index.php");
exit();
}
发布于 2018-12-13 05:56:56
去掉你时间格式中的"A“:
$time = date('H:i:s');
如果你使用的是当前时间,你也不需要第二个参数。
https://stackoverflow.com/questions/53751924
复制相似问题