ludah Posted January 12, 2015 Share Posted January 12, 2015 Please I want get data from mysql; 1. The last 24 hours. 2 the last 7 days 3. the last Months 4. Last 12 hoursplease try and help me Quote Link to comment Share on other sites More sharing options...
Solution Barand Posted January 12, 2015 Solution Share Posted January 12, 2015 SELECT .... FROM tablename WHERE datetimefield > NOW() - INTERVAL 24 HOUR SELECT .... FROM tablename WHERE datetimefield > NOW() - INTERVAL 7 DAY SELECT .... FROM tablename WHERE datetimefield > NOW() - INTERVAL 1 MONTH SELECT .... FROM tablename WHERE datetimefield > NOW() - INTERVAL 12 HOUR Quote Link to comment Share on other sites More sharing options...
ludah Posted January 12, 2015 Author Share Posted January 12, 2015 Thank you very much 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.