grahamgr3 Posted February 22, 2014 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 Link to comment Share on other sites More sharing options...
HartleySan Posted February 22, 2014 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.) Link to comment Share on other sites More sharing options...
Recommended Posts