[英]Email Sender In PHP/MySQL
I am trying to build an email sender in PHP/MySQL where you can choose the group of people (in dropdown menu) and send them a message. 我正在尝试在PHP / MySQL中构建电子邮件发件人,您可以在其中选择一组人(在下拉菜单中)并向他们发送消息。 I have a {users} table with emails and I am having trouble figuring out how to do groups table.
我有一个包含电子邮件的{users}表,但在弄清楚如何做group表时遇到了麻烦。
What columns should I have? 我应该有哪些专栏? or Any other way to do the same thing?
还是有其他方法可以做同样的事情?
I would be really grateful if you could explain like you would to a beginner :) 如果您能像初学者一样解释,我将不胜感激:)
Thank you) 谢谢)
You're looking for a many-to-many relationship, which will look something like this (three tables): 您正在寻找多对多关系,它看起来像这样(三个表):
group 组
id
name
user_groups user_groups
id
user_id
group_id
users 用户
id
name
email
Whenever a user is added to a group, you will insert a row into the user_groups
table. 每当将用户添加到组中时,您都会在
user_groups
表中插入一行。
Have a read on Database Normalization . 阅读数据库规范化 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.