Extract the appropriate email addresses form database
Confused over this, should be easy...
I am doing a basic newsletter sender.
A newsletter gets created and then sent to all those who have subscribed to the category so if the category is "Cat Breeding" and a person is signed up for that category then when I create a newsletter "Cat Breeding for Beginners" it is sent to all subscribers...
The code for the tables that I have done is below.
Question.... what is the PHP code needed to extract the appropriate email addresses from the database?
I.E.: only those who have signed up for that newsletter category.
Confused over this, should be easy...
I am doing a basic newsletter sender.
A newsletter gets created and then sent to all those who have subscribed to the category so if the category is "Cat Breeding" and a person is signed up for that category then when I create a newsletter "Cat Breeding for Beginners" it is sent to all subscribers...
The code for the tables that I have done is below.
Question.... what is the PHP code needed to extract the appropriate email addresses from the database?
I.E.: only those who have signed up for that newsletter category.
Code:
TABLE newsletters
1 newsletterid int(4) PRI auto_increment
2 newslettercategoryname varchar(100)
3 newslettername varchar(100)
4 newslettersubject varchar(200)
5 newslettercontent text
6 newslettercreatetime varchar(30)
7 newsletterupdatetime varchar(30)
TABLE subscribers
1 newsletterid int(4) PRI 0
2 subscriberid int(12) PRI auto_increment
3 email varchar(50) PRI
4 subscribersignuptime varchar(30)
5 subscriberupdatetime varchar(30)
6 subscriberipaddress varchar(30)