P
P
pcdesign2015-12-16 17:09:49
MySQL
pcdesign, 2015-12-16 17:09:49

How to store information about reading a message?

There is one user and ten admins.
The user sent one private message to the administration.
Ten admins have information about a new message on fire.
When an admin has read a message, the message is marked in the database.
For the remaining nine admins, the message remains active until read.
Question: What will be the structure of the message table in MySQL?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2015-12-16
@pcdesign

Answer: the same as it was. Such things are implemented by a separate connection table unreaded_messages(message_id, admin_id). Otherwise, when adding the eleventh admin, you will have to redo the entire message table.

R
Robot, 2015-12-16
@iam_not_a_robot

message
id table | value - where id is the ID of the user who sent the message, value - 0 or 1 all admins request value and everyone gets 1 (the message is on for all), when the first one opens the message, an update is made and value becomes 0, and if 0, then the rest of the admins no longer have a notification about a new message.

L
LittleFatNinja, 2015-12-16
@LittleFatNinja

one user and ten admins.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question