How do I create a user history?

Posted by ggfan on Stack Overflow See other posts from Stack Overflow or by ggfan
Published on 2010-05-13T01:24:27Z Indexed on 2010/05/13 1:34 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

I want to create a user history function that allows shows users what they done. ex: commented on an ad, posted an ad, voted on an ad, etc.

How exactly do I do this?

I was thinking about... in my site, when they log in it stores their user_id ($_SESSION['user_id'])

  1. so I guess whenever an user posts an ad(postad.php), comments(comment.php), I would just store in a database table "userhistory" what they did based on whenever or not their user_id was activate.
  2. When they comment, I store the user_id in the comment dbc table, so I'll also store it in the "userhistory" table.
  3. And then I would just queries all the rows in the dbc for the user to show it

Any steps/improvements I can make? :)

© Stack Overflow or respective owner

Related posts about php

Related posts about user