graham23s Posted May 11, 2007 Share Posted May 11, 2007 Hi Guys, I was wondering if any of you guys could advise me on the best way to do this: i was wanting users on my site to see the last 5 or 10 users that had visited there profile, what would be the best way to do this, (i'm not asking for code unless you have it lol) just the "do this, do that" kinda thing. thanks guys Graham Quote Link to comment Share on other sites More sharing options...
taith Posted May 11, 2007 Share Posted May 11, 2007 are they going to be other users? if so... storing their userid's to the database... say "12324|324|2121|4352|435"... then explode, and grab usernames from database... are your best/fastest method i would say :-) Quote Link to comment Share on other sites More sharing options...
graham23s Posted May 11, 2007 Author Share Posted May 11, 2007 Hi Mate, that sounds good, should i store there id's in the same row as the users? i.e id: graham23s age: 28 visitors_id: 4533 or in a whole new table? cheers mate Graham Quote Link to comment Share on other sites More sharing options...
taith Posted May 11, 2007 Share Posted May 11, 2007 personally... i wouldnt make a new table for just that... i'd probably set it right into the table which controls those webpages :-)... once you have the id list... $list=explode('|',$row[lastusers]); foreach($list as $v){ $query=mysql_query("SELECT `name` FROM `users` WHERE `id`='$v' LIMIT 1"); $row=mysql_fetch_array($query); $lastusers[]=$row[name]; } you could instead store the name into the table... however i like stuff being automatic(if they changed names, etc)... thats just me tho :-) Quote Link to comment Share on other sites More sharing options...
graham23s Posted May 11, 2007 Author Share Posted May 11, 2007 Thanks T i'm on it:) Graham Quote Link to comment Share on other sites More sharing options...
Nameless12 Posted May 11, 2007 Share Posted May 11, 2007 If I was going to do this I would just record all the request data for each http_request along with the users information, the profile page for each user will have a unique url, something like ?profile=name so you can just search through the logs and pay attention to the user_ids in the result. 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.