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

WBOY
Release: 2016-06-23 13:34:03
Original
893 people have browsed it

$sri = "1990";
$sri="2";
$sri="10";
$sri = $sri_n."-".$sri_y."-".$sri_r;

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

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


回复讨论(解决方案)

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

如果你的数据只有年月日,可以用date类型。

字段类型改为date即可。

 谢谢两位版主

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!