Hi All,
[edit]
Please note, this is NOT used for SPAM, this is for teachers who have signed up for one free video per year and we now have it integrated with our SQL CRM program. We are getting an enormous amount of traffic (since we give them a video worth $30-$40 dollars for free). We have given away thousands in several days.
[/edit]
Before this promo, we would have 10 -20,000 hits a month, now we are getting 11,000+ a day.
Good news, but my sendmail app was timing out after a few thousand, so I started breaking it down into batches of 1,000 at a time. Now, I need to make it dynamic based on the #s of IDs in the db.
IE
I have a send form page that takes you to page 2 when done. Now I added 10 pages to send to 10,000 ID's (10 pages total). Our SQL CRM program will be storing the records soon, and is capable of mailing large numbers, vs. my hack way of doing it, but I need to make it to there.
Heres my way of getting the IDs for each send (I would like to make the query to check if we need a new page based on having more than the 9,000 IDs in this case).
include('conn.php');
$ce = "ce";
$Date = date('l, F d, Y');
$Start = '8001';
$End = '9000';
$email_dbname = "signups";
mysql_select_db ($ce, $conn) or die (mysql_error());
$query = "SELECT * FROM daily_email WHERE Active='1' AND ID>='" . $Start . "'"; //check to see if there is now over 9000 IDs ($Start)
$getrow = mysql_query($query, $conn) or die(mysql_error());
while($row = mysql_fetch_array($getrow)) {
$link = TRUE; //set the link to TRUE to show the send form
}
if($link==TRUE) {
// show the send form here
// show the link to the next page to send the next 1000 emails
} else {
echo 'there is less than ' . $Start / ' records. Nothing to send yet.';
die();
}
Then my sendmail page queries the db and loops thru all records from $Start to $End.
I could use some guidance on how to make the query more dynamic so I dont need to keep manually setting $Start $End and create a new page (with a link to it) each time.
Does that make sense?
I appreciate the help in advance,
Don