help with mailing list

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ferio-moreno
Forum Commoner
Posts: 30
Joined: Tue Feb 28, 2006 10:31 pm
Location: florida

help with mailing list

Post by ferio-moreno »

Hiya,

My new project at work is to design a mailing list for the employees. I've got that all done, but now, he wants me to:

Have the php script be initiated every 30 seconds, and each time its initiated to startup after the previous queue (not include the members who hav already been added to a list to be emailed).

How would you folks go about doing this, I don't think i'll need a code example, just a detailed description.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: help with mailing list

Post by Chris Corbyn »

ferio-moreno wrote:Hiya,

My new project at work is to design a mailing list for the employees. I've got that all done, but now, he wants me to:

Have the php script be initiated every 30 seconds, and each time its initiated to startup after the previous queue (not include the members who hav already been added to a list to be emailed).

How would you folks go about doing this, I don't think i'll need a code example, just a detailed description.
Keyword: CRON

Google it ;)
ferio-moreno
Forum Commoner
Posts: 30
Joined: Tue Feb 28, 2006 10:31 pm
Location: florida

Post by ferio-moreno »

i already know about CRON, but before I do that,

Is there way to compare values between 2 lists?
who i have sent to, and who i am going to send to?
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Post by aerodromoi »

ferio-moreno wrote:i already know about CRON, but before I do that,

Is there way to compare values between 2 lists?
who i have sent to, and who i am going to send to?
Why don't you use a two-dimensional array (email address and whether the mail has been sent or not)?

eg.

Code: Select all

$list = array(
  array("user01@emailaddress.com",true),
  array("user02@emailaddress.com",false),
  array("user03@emailaddress.com",false)
);
aerodromoi
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ferio-moreno wrote:i already know about CRON, but before I do that,

Is there way to compare values between 2 lists?
who i have sent to, and who i am going to send to?
Use a database. Create a new recordset for each mail you're sending, store the addresses in another table and store the link between the two in a third table. Set a flag to "yes" when a mail has been sent to any of the users. If you work through the database in a sortable order each time you do this you should be able to pick up where you left off each time.
ferio-moreno
Forum Commoner
Posts: 30
Joined: Tue Feb 28, 2006 10:31 pm
Location: florida

Post by ferio-moreno »

awesome, thx alot bro,


quick question though, is there a way to screw around with the SELECT statement to say select 30 records at a time?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ferio-moreno wrote:awesome, thx alot bro,


quick question though, is there a way to screw around with the SELECT statement to say select 30 records at a time?
Limit to 30 results

Code: Select all

select
   whatever
from
    wherever
limit 30
Limit to 30 results starting from number 60

Code: Select all

select
   whatever
from
    wherever
limit 60, 30
ferio-moreno
Forum Commoner
Posts: 30
Joined: Tue Feb 28, 2006 10:31 pm
Location: florida

Post by ferio-moreno »

awesome, thx alot bro :D
Post Reply