Home  >  Article  >  Backend Development  >  PHP时间有关问题

PHP时间有关问题

WBOY
WBOYOriginal
2016-06-13 10:12:01946browse

PHP时间问题
注册时$regdate = date("Y-m-d")
存入数据库 但是注册后查看数据库中时logtime中均显示0000-00-00
用输出语句查看时显示1970-01-01
是什么原因?如何改动

------解决方案--------------------
其实你直接
$sql = "INSERT INTO register(name,password,email,logTime,score)VALUES('$username','$password','$email',now(),10)";
更好些

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn