Jump to content

Message System (Advice only really)


fife

Recommended Posts

Hey Guys

 

Im just after advice really with this question

 

Basically I'm trying to design my first message system.  One that once a user has read the message you can tick ok and its then gone forever.  Now my boss says you have the message table

 

MESSAGE

 

messageID, Message

 

then within the members table you have a field called messageID.  Within this field you will store the ID's of all the messages the user has read.  Upon login to the website you will check for ID's in the message table that do not exist in the messsageID of the users table.

 

 

Is this correct or a really bad way of doing this?  If I have to do it this way there will be a massive learning curve on my php knowledge.  Does anybody know of a better way of doing this or a cool website to learn from?

 

Thanks

 

Danny

 

 

 

 

Link to comment
Share on other sites

The only issue i can see with storing the IDs of 'read' messages is that you will be filling up that cell with useless data.

 

So would it not be a better idea store the ID of new messages in the members table when new messages are created. Then once the user has read the message that ID is removed from the user's messageID field. Thereby you are removing data rather than contantly addnig to it.

 

This does depend of course on the process of creating new messages and whether this can practically work.

Link to comment
Share on other sites

Cool ok thank you. That makes sense.  However in this case the administrator comes along and adds say a message saying

 

"there have been changes to our terms click here to close"

 

the ID of that message upon creation will have to be added to all of the users accounts within the database.  Is this standard practise?  I really have no idea about this part of a website as I have never done it before.

Link to comment
Share on other sites

Can see that being a problem. If your boss is happy with the approach of adding 'read' message IDs to a field in the users table i can't see an issue with flipping it round and adding 'unread' IDs. So everytime a new message is created then it would add it's ID to the users table. Once they view and click "don't show, or whatever, you remove the ID from the user's table.

 

As far as standard practice I am not entirely sure. Haven't really built this into anything i've worked on but as always there are about ten ways to get to the same end goal and this sounds fairly reasonable.

 

 

 

Cool ok thank you. That makes sense.  However in this case the administrator comes along and adds say a message saying

 

"there have been changes to our terms click here to close"

 

the ID of that message upon creation will have to be added to all of the users accounts within the database.  Is this standard practise?  I really have no idea about this part of a website as I have never done it before.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.