Notification since last logged in
Hey guys, I'm just wondering if anybody has any idea on this.. i'll try to illustrate it out...
i'm trying to have a notification feature similar to what forums like this one has... everytime i come back, the threads with recent posts gets bolded.. I'm wondering how abouts to achieve this resource efficiently
My DB Stucture (relavent)
Table of Posts (Similar to threads)
Table of Comments (Similar to posts of threads)
Table of Members
Table of Log in times
So as a user if I created a post and people comment on the post I would be notified of comments and how many comments has been made... so the idea I had was that:
Everytime I logged in or reloads a page I would get my last login time and compare it to all comments of posts I've made... something like: (not sure if it works just thinking off the top of my head).
$get_notify = "SELECT * FROM table_of_comments WHERE post_id='(SELECT * FROM table_of_posts WHERE mem_id='my_id')' AND post_time>'$last_login_time'";
But I was wondering if running this query every page load would bog down load time and if there's a better way in which php forums do this...
|