Page 1 of 1
help with mailing list
Posted: Thu May 18, 2006 2:10 pm
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.
Re: help with mailing list
Posted: Thu May 18, 2006 2:58 pm
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

Posted: Thu May 18, 2006 3:06 pm
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?
Posted: Thu May 18, 2006 3:18 pm
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
Posted: Thu May 18, 2006 4:06 pm
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.
Posted: Fri May 19, 2006 10:42 am
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?
Posted: Fri May 19, 2006 11:42 am
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
Posted: Fri May 19, 2006 1:17 pm
by ferio-moreno
awesome, thx alot bro
