doulun1939 2012-03-14 06:41
浏览 63

应该是什么表结构来维护登录注销日志?

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.

  • 写回答

4条回答 默认 最新

  • dpy33121 2012-03-14 06:47
    关注

    my suggestion is that if you want information of last log in and last log out only then.... make the user_id as primary key... and just change that information instead add new record... you can add one count field to enhance your functionality... to get number of count the person is log in...

    and if you want each and every login data... just go with the serialization concept... it will help... make array set count as key and your last login, logout, browser as a value of array...serialize that and store in database...

    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口