How can I implement notifications on the php site?

Source: Internet
Author: User
How to implement the php intra-site notification problem? only the intra-site notification management can send notifications in the background (send notifications to a group or send notifications to a specified member) & nbsp; the user only accepts the view notification and does not have the sending permission. Currently, there is a & nbsp; my_messages table structure as follows: send notifications to specified members; after inserting a piece of data in my_messages, how do I design the table & nbsp; and & nbsp; real php site notifications?
Only intra-site notifications are required.
Management can send notifications in the background (send notifications to a group or send notifications to a specified member). Users can only view notifications and have no permission to send notifications.

There is currently a my_messages table
The structure is as follows:


To send a notification to a specified member, you must insert a data entry in my_messages.

How do I design tables and implement group notifications for all site members?


Share:


------ Solution --------------------
I think it is better to use two tables, one for storing user messages (usermsg) with userid, msgid, status
Another table (msg) stores the message content, id, content, inserttime, etc,
If you want to send messages to a group, insert the msg table first, and then insert the id to the usermsg table.
------ Solution --------------------
If it is mine, my table structure will be:
Id message userlist
Id: the id of all users in the message body is combined into an array, and then serialized into string type data is stored in this column

When a user has read the userlist, the userlist content is obtained, and the reverse string content is converted into an array. the user id is deleted and serialized into the userlist column.
------ Solution --------------------
I also encountered this problem,

Two tables
One table stores notification information: id, title, content, ctime, author, state
The other table stores the user's reading information:
Id, sid (corresponding to the notification table id), uid (user id), view (read or not), hide (empty or not), ctime

What do you think?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.