Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:25:10+00:00 2026-06-05T11:25:10+00:00

I just have a general database theory question. I have a need to make

  • 0

I just have a general database theory question. I have a need to make something similar to showing what posts/items a user has viewed or not (such as in a forum) or an unread email message. What I have is there are posts that multiple users can view, but it needs to separate by user who has actually viewed it. So if User A viewed Post 1, it would no longer show that Post 1 is a new item to view, but to User B, it would still show that Post 1 is a new item to view.

I’ve search for other ideas and one of them is to get a timestamp of when the user last logged in, but I actually need to keep track of the posts they’ve seen as opposed to posts that have happened since they last logged in.

I would like a MySQL database solution if possible, but I’m open to cookies if that is a must. I could do this on my own and just figure it out, but I’d appreciate any advice on how to properly structure a table(s) to make this the most efficient. Also, bandwidth and storage is not issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:25:12+00:00Added an answer on June 5, 2026 at 11:25 am

    While reviewing the relevant schema for phpBB, I found the following:

    # Table: 'phpbb_topics_track'
    CREATE TABLE phpbb_topics_track (
        user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
        PRIMARY KEY (user_id, topic_id),
        KEY topic_id (topic_id),
        KEY forum_id (forum_id)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    

    And:

    # Table: 'phpbb_forums_track'
    CREATE TABLE phpbb_forums_track (
        user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
        mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
        PRIMARY KEY (user_id, forum_id)
    ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
    

    Then I look here in their wiki:

    This table keeps record for visited topics in order to mark them as
    read or unread. We use the mark_time timestamp in conjunction with
    last post of topic x’s timestamp to know if topic x is read or not.

    In order to accurately tell whether a topic is read, one has to also
    check phpbb_forums_track.

    So essentially they have a lookup table to store the data associated with a user’s viewing of a topic (thread), and then check it against the timestamp in the forum view table, to determine whether the topic has been viewed by the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question that doesn't need any specific answer, just a general direction
just a general question, do you ALWAYS have to handle error? i was just
Just a general database design question - no programming, but a bit of problem
My general question is, say you have a SQL Server 2005 database that's 20G
I just started using php arrays (and php in general) I have a code
I just have a quick question about how to get the length of a
I just have a question regarding SimpleJSON's documentation. Is it implicit understood that functions
I just have a question thats been pozzling my head all morning. I want
I just have the array of 15 values that all need to be inserted
I have a general IO question. I was trying to replace a single line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.