PHP头条
热点:

急PHP,数据库中createtime字段类型为datetime,怎的根据这个查询一段时间内的数据


急急急,PHP,数据库中createtime字段类型为datetime,怎样根据这个查询一段时间内的数据
数据库中createtime字段类型为datetime,是年月日时分秒,怎样把他转换成时间戳?数据很多,一条好转换,可是那么多怎么办?
------解决方案--------------------
select unix_timestamp('2011-4-19 12:00:00');

------解决方案--------------------
查询可以直接比较
例如:select * from table where createtime>='2014-01-01 00:00:00' and creattime<'2014-01-31 00:00:00';

如果要批量显示可以这样
select *, unix_timestamp(createtime) as createtime from table;
------解决方案--------------------
select * from table where createtime>='2014-01-01 00:00:00' and creattime<'2014-01-31 00:00:00';

www.phpzy.comtrue/phprm/5624.htmlTechArticle急PHP,数据库中createtime字段类型为datetime,怎的根据这个查询一段时间内的数据 急急急,PHP,数据库中createtime字段类型为datetime,怎样根据这个查询一段时间内的数据 数据库中createt...

相关文章

相关频道:

PHP之友评论

今天推荐