phrozenflame Posted December 30, 2006 Share Posted December 30, 2006 On my users table on my mysql db i have a field called "lastlogin". This is the date when the person last logged on my site and is in the format "hh:mm:ss - dd:mm:yyyy" eg"13:46:28 - 18/11/2005"I want to make something so I can see who hasnt logged in within (x) amount of days.I know know to explode it so I can get just the 18/11/2005 bit but how would I make it so I can list only those entrys that havent logged in within (x) days? Link to comment https://forums.phpfreaks.com/topic/32316-trouble-with-dates/ Share on other sites More sharing options...
emehrkay Posted December 30, 2006 Share Posted December 30, 2006 is it storing it in the db as hh:mm:ss - dd:mm:yyyyor with mysql's datetimeyyyy-mm-dd hh:mm:ss?? Link to comment https://forums.phpfreaks.com/topic/32316-trouble-with-dates/#findComment-150034 Share on other sites More sharing options...
phrozenflame Posted December 30, 2006 Author Share Posted December 30, 2006 Like this storinghh:mm:ss - dd:mm:yyyy Link to comment https://forums.phpfreaks.com/topic/32316-trouble-with-dates/#findComment-150035 Share on other sites More sharing options...
emehrkay Posted December 30, 2006 Share Posted December 30, 2006 is it just a varchar field?if so change it to datetimeand when you put it in the db, make sure you use this formatyyyy-mm-dd hh:mm:ssthat will make it easier to do date calculations in your queries. Link to comment https://forums.phpfreaks.com/topic/32316-trouble-with-dates/#findComment-150044 Share on other sites More sharing options...
phrozenflame Posted December 30, 2006 Author Share Posted December 30, 2006 Thanks a lot Link to comment https://forums.phpfreaks.com/topic/32316-trouble-with-dates/#findComment-150050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.