Jump to content

Fetching Last 24 hours Records from DB


vinay_forum

Recommended Posts

Are you storing a datetime field or a timestamp field? If so you can select on that.

 

SELECT [fields] FROM [table] WHERE [datetime_field] > NOW() - INTERVAL 24 HOUR ORDER BY [datetime_field];

 

If not then you're out of luck. You could potentially look at your bin logs but it would be much easier to just add a field.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.