1990-2-10 这样的格式存入数据库变为 1990-2-10 00:00:00 肿么办

WBOY
Release: 2016-06-13 12:20:31
Original
1049 people have browsed it

1990-2-10 这样的格式存入数据库变成 1990-2-10 00:00:00 肿么办啊
$sri = "1990";
$sri="2";
$sri="10";
$sri = $sri_n."-".$sri_y."-".$sri_r;

存储该数据的字段类型为datetime;

是数据库字段问题么 还是怎么回事啊...

------解决思路----------------------
datetime 就包括年月日时分秒。你没有填入时分秒就会填入默认的00:00:00

如果你的数据只有年月日,可以用date类型。
------解决思路----------------------
字段类型改为date即可。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!