我想从表中检索所有记录,这些记录是使用php mysql在24小时后发布的

我想从表中检索所有记录,这些记录是使用php mysql在24小时后发布的

问题描述:

I want to retrieve all the records from a table which were posted 24 hours back using php mysql. I can able to get last 24 hour inserted records using datetime column. But i want the records which were inserted into table and completed 24 hours from posting.

Please guys help me out!

我想从表格中检索所有记录,这些记录是使用php mysql 24小时发布的。 我能够 使用datetime列获取最近24小时插入的记录。 但是我希望记录插入表格并在发布后24小时内完成。 p>

请大家帮助我! p> div>

Assuming that "date" is your datetime column and "mytable" is your table

SELECT * FROM mytable WHERE date <= DATE_SUB(NOW(), INTERVAL 24 HOUR)