grahamgr3 1 Posted February 22, 2014 Report Share Posted February 22, 2014 Can anyone provide me with a simple solution to the Pursue question in chapter 18, create a last_login field and make it so that a user can see how long it has been since they last logged in. thanks Graham Quote Link to post Share on other sites
HartleySan 826 Posted February 22, 2014 Report Share Posted February 22, 2014 Assuming you have the last_login field being properly updated in the DB, you can compare that value to the current time. The following is a good, simple way to calculate the difference between the two: http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php (Both Emil H and jurka provide good answers in the SO post above.) Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.