Home >Backend Development >PHP Tutorial >怎么在mysql中用PHP插入日/月/年格式的日期呀!大侠帮忙

怎么在mysql中用PHP插入日/月/年格式的日期呀!大侠帮忙

WBOY
WBOYOriginal
2016-06-13 10:04:501067browse

如何在mysql中用PHP插入日/月/年格式的日期呀!!大侠帮忙
INSERT INTO LoginStatus (uname, type, intime) VALUES ('jack', 1, '20/5/2011')  
用这条插入后mysql中显示的全是0
请帮忙!

------解决方案--------------------
date类型应该是 YYYY-MM-DD或 YY-MM-DD形式的,你的这种20/5/2011大概没有被识别吧 ,换成 2011/05/20 试试

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