i have a forum, with new posts how do i use sessions for each user to determine if the posts clicked on and not? I'm guessing sessions because that is individual to the user...

e.g.

new post, then click on not new post.


i can't assign this to the actual post or then it would display as not new post for other users that haven't seen it.

i can't use time either, because i want it if it's been clicked on by a user or not.

any tips?

i would would suggest i dont know if this is the right way but i would make a table that has a index / username / post_id
so every time the user would click on the new post it would write to the table that he saw it you can also add the date too if you want to show him when he looked at it so then when u load the main page you just query the data into a array from the user and check it against that

i would would suggest i dont know if this is the right way but i would make a table that has a index / username / post_id
so every time the user would click on the new post it would write to the table that he saw it you can also add the date too if you want to show him when he looked at it so then when u load the main page you just query the data into a array from the user and check it against that

I agree. Having a giant table with columns for postid, user, clicked will be able to do the job as then you can use join mysql query's when selecting and get it all to display right the first time round with better efficiency.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.