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 145293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:23:52+00:00 2026-05-11T08:23:52+00:00

I’m developing a new site, and I have to make private messages for our

  • 0

I’m developing a new site, and I have to make private messages for our users. I have already made this on other projects, but the design there just doesn’t seem right (I can’t have more than two people engaged in a message for instance). So what is the ‘right’ approach to this? I’d like to offer my users the same functionality as Facebook (again, I have already done this but it feels dirty :)) So the system should support 2 or more users in a conversation and thread-like messages.

I was thinking and one solution would be to have two tables like so:

pm_messages: id | pm_messages_id |user_id | title | content | date_time

pm_recipients: id | pm_messages_id | user_id | has_seen | deleted

I would store the actual content in the ‘pm_messages’ table, and I would store the recipients (including the original sender) in the ‘pm_recipients’ table.

Is this the right direction or am I completely off with this? What bothers me here is that messages don’t really get deleted until all of the recipients have deleted the message which leads to some awkward deleting logic.

  • 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. 2026-05-11T08:23:53+00:00Added an answer on May 11, 2026 at 8:23 am

    If there can be multiple recipients, and they can send reply msgs, you are more dealing with some kind of chat application. You could store the ‘chat’ sessions, or conversations in a seperate table with 1-n relation between conversation and participant, as well as 1-n relation between conversation and message (tables laid out below). But in the end, it’s of course up to you. For regular message sending, a 1-n between message and recipient as you use will do.

    table user: - id (pk) - name  table conversation (one entry per 'chat/messaging' session) - id (pk) - started_by_user_id - started_ts  table conversation_participant (keeps track of all recipients) - id (pk) - conversation_id - user_id (refers to user.id)  table message - id - conversation_id (refers to conversation.id) - sender (refers to user.id) - msg 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.