rwilmot1 Posted February 11, 2010 Share Posted February 11, 2010 Hi Guys, This is my first post so pleas be gentle I have only been coding PHP for the past month or so and have created a log diary. I have set up the fields and calendar entries as well as other bits and bobs. What I want to do now is call data from the mysql database but for records that were created in the past 12 hours, then another report for the past 24 hours, then 36 etc. I do have a timestamp entry in the mysql table. I hope that makes sense???! If it doesn't then I will try and provide more detailed info along with some code Quote Link to comment Share on other sites More sharing options...
sader Posted February 11, 2010 Share Posted February 11, 2010 well one simple way could be such as: SELECT * FROM `log` WHERE `time` > UNIX_TIMESTAMP() - 3600 * 12 SELECT * FROM `log` WHERE `time` > UNIX_TIMESTAMP() - 3600 * 24 SELECT * FROM `log` WHERE `time` > UNIX_TIMESTAMP() - 3600 * 36 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.