Results 1 to 11 of 11
Thread: 2 min ago and timestamps??
May 12, 2009, 21:13 #1
2 min ago and timestamps??
I have column in database named as recente_visited, and it has type as timestamps. basically i am checking the user recent most time for a perticular page on my website.
so my recent visited time is stored something like this
visitor _id recent_visited
4 2009-05-13 10:37:55
now i want to show on page that this visitor visited 2 min ago, 30 min ago something like that. and i have to show 5 visitors on that page with there time. how can i achive that?
i have logic in mind
$visit = NOW() -recent_visited
but then again how can i apply it in my selection query?
"SELECT a.username,a.avatar,r.visitor_id,r.visiting_count,r.recent_visited FROM recent_visitor as r ,author as a WHERE (r.visitor_id = a.id) AND r.profile_owner = '$uid' ORDER BY r.recent_visited DESC LIMIT $start, $limit_value"
thanks in advance.