Database design for unread messages in mysql?
What would be the best way to check unread messages from the mysql table ...
I have two tables one for users and the other for messages ... In the users table I keep the last registration column and in the messages table a column with date added, but which would be better a way to check if the user has accessed the messages or not ....
I'm thinking of adding another update query to the select query for messages and adding another column (read) to the messages table and setting the read to yes or no ... any other suggestions? thank
source to share
Yes, the read column will be the best, logging in (time) does not mean the message has been read. Thus, the best metric is the reading for displaying messages to read.
Edit:
You might want to expand on the idea of "status" to include things like read times, notifications, redirects, and replies.
source to share