Home >Backend Development >PHP Tutorial >如何返回特定时间戳之前第一个帖子所在的日期的全天帖子?

如何返回特定时间戳之前第一个帖子所在的日期的全天帖子?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:39:461125browse

如题

数据库中日期使用 PHP(10位) 时间戳储存
想根据时间戳 请求 这时间戳之前第一个帖子所在日期的一整天帖子数据
请问如何获取?

表名 posts
时间戳 created int(10)

回复内容:

如题

数据库中日期使用 PHP(10位) 时间戳储存
想根据时间戳 请求 这时间戳之前第一个帖子所在日期的一整天帖子数据
请问如何获取?

表名 posts
时间戳 created int(10)

<code>SELECT @d := created FROM posts WHERE created = (@d - @d % (24*60*60));
</code>
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