cruxaders Posted March 7, 2011 Share Posted March 7, 2011 Anyone can help me how to get the time when log.in and the time when log.out then it will store in database... tnx Quote Link to comment Share on other sites More sharing options...
beegro Posted March 7, 2011 Share Posted March 7, 2011 Could you post some of your code? It's hard to help if we can't see the problem. Quote Link to comment Share on other sites More sharing options...
cruxaders Posted March 7, 2011 Author Share Posted March 7, 2011 I still dnt have any codes for it im still searching in net on how to get the current time using PHP.... if anyone have idea..feel free to reply and help me Quote Link to comment Share on other sites More sharing options...
litebearer Posted March 7, 2011 Share Posted March 7, 2011 Have you looked here?... http://php.net/manual/en/function.time.php Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 7, 2011 Share Posted March 7, 2011 #on login, run this query: mysql_query("UPDATE user_table SET last_login = NOW() ")or die(mysql_error()); #on logout, run this query: mysql_query("UPDATE user_table SET last_logout = NOW() ")or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
cruxaders Posted March 7, 2011 Author Share Posted March 7, 2011 ohdang8888 that was nice... i have a little question regarding with ur codes user_table = table name and last_login = the field name where the time will save... how about on the database i have.. should my log.in field looks like this Field name = login types = datetime Null = no Default = none sorry for my noob question.. and btw tnx to all Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 7, 2011 Share Posted March 7, 2011 i have a little question regarding with ur codes user_table = table name and last_login = the field name where the time will save... how about on the database i have.. should my log.in field looks like this Field name = login types = datetime Null = no Default = none yup that's all right 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.