How to make a notification for a group of users with the read / unread flag?

I am creating a notification system so that when users in a group perform an action, it will notify all other users in the group. I want the notification to be marked as β€œread” or β€œunread” for each user in the group. Thanks to this, I can easily restore any unread notification to the user and display it. I am thinking of creating a notification table with the following fields.

+----------------------+
| notification         |
+----------------------+
| id                   |
| userid               |
| content              |
| status (read/unread) |
| time                 |
+----------------------+

My question is:

  • Is this the right way to build a system? Since this means that when there are 1000 users in a group, I need to insert 1000 rows into the table. If not, what is the best way to do this?
  • , php/mysql, ?

!

+4
3

- , :

Table Notification
------------------
not_id
time content

Table User
----------
u_id

Table NotificationStatus
------------------------
id
u_id
not_id
bool read

, , / .

+1

.. .. : , "PQP" (user_id = 1) , ( , , ) ur ur

id = 1                
userid =1           
content = "Photo Added By User PQP"            
status = Unread
time = currenttime

, evr some1 , .

0

:

Table: Events
----------------
event_id
user_id (foreign key to users table)
action_id (foreign key to actions table)
time_stamp

Table: Log
----------------
user_id (foreign key to users table)
event_id (foreign key to events table)
time_stamp

, X, event_id

.

, "" , . .."...

0

All Articles