Help with MySQL database structure - user notification system
Posted
by
Simon
on Stack Overflow
See other posts from Stack Overflow
or by Simon
Published on 2011-01-09T16:35:33Z
Indexed on
2011/01/09
16:53 UTC
Read the original article
Hit count: 206
mysql
|database-design
Hi,
I'd like to send global notifications to my users (1000+ users) and allow them to close the notification box once they have read the message.
Basically I may send one notification per week globally ie/ each user get the same message and they are not personal in nature.
What is the best way to achieve this?
Create 2 tables:
**tb_messages**
message_id
massage_title
message_content
**tb_read_messages**
user_id
message_id
is-read
That way i can just show each user the current notifications that are not read?
select * from tb_read_messages WHERE user_id = $user_id AND is-read = no
OR is there a more efficient way?
Thanks!!!
© Stack Overflow or respective owner