fife Posted January 26, 2012 Share Posted January 26, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/255816-message-system-advice-only-really/ Share on other sites More sharing options...
Drongo_III Posted January 26, 2012 Share Posted January 26, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/255816-message-system-advice-only-really/#findComment-1311365 Share on other sites More sharing options...
fife Posted January 26, 2012 Author Share Posted January 26, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/255816-message-system-advice-only-really/#findComment-1311369 Share on other sites More sharing options...
Drongo_III Posted January 26, 2012 Share Posted January 26, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/255816-message-system-advice-only-really/#findComment-1311378 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.