Do you guys have any experience in designing the database of the website message center? There are all messages unread messages read messages one-click ignore function.

* * the current idea is two tables

  1. platform message table-send messages to all users
  2. user Reading record Table has a field msg_ids records all the id users who read the message read a message, splicing the message id to the end of the msg_ids

read message: take out all msg_ids id, search platform message table
unread message: Filter msg_ids all id, take the rest
feel this is a bit hasty, what do the bosses think? * *

Apr.09,2021

Why not use a table to handle user_id (user id), msg (messages). (other fields), is_read (read or not).
all messages: user_id=XXX
unread: user_id=XXX and is_read = 0
read: user_id=XXX and is_read = 1
ignore: update is_read = 1 where user_id=XXX and is_read = 0


change your train of thought and send it to all users with one announcement.
this facilitates unified message processing.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-34f60d4-1f5da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-34f60d4-1f5da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?