I have loginlog table as following
Field Type
login_id int(10) NOT NULL
platform varchar(50) NOT NULL
browser varchar(50) NOT NULL
ipaddress varchar(50) NOT NULL
last_login datetime NULL
last_logout datetime NULL
But on this structure I am confuse that I can add login time but its hard to update it for logout time. I have not added primary key because logs are frequent and primarykey will soon reach it max value. What should be the best way? Please help.
Having a single row with both login and logout like that is just asking for trouble, because it assumes that every login has a corresponding logout, which is just not the case. Sometimes they will login on a public computer and never log out, sometimes they will open an anonymous window and login.
Instead, I would cut it down to just a type:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With