It's a MYSQL database with maybe 100 records. The script loops through and sends an email to records that have notifications set to yes
BTW, I just thought of something. Maybe my code is off. I have 2 email fields in each database records, (email, email2). Each email field can have a notification set or not. I'm looping through twice, maybe that's the problem.
$SQL = "select * from $resident_info_table where email!='' and email_a +lert = 'yes' order by ID desc"; &Do_SQL; while ($pointer=$sth->fetchrow_hashref) { $recipient = $pointer->{'email'}; &send_email; } $SQL2 = "select * from $resident_info_table where email2!='' and email +2_alert = 'yes' order by ID desc"; &Do_SQL2; while ($pointer2=$sth2->fetchrow_hashref) { $recipient = $pointer2->{'email'}; &send_email; }
Is there a way to do both queries in one sql search?
In reply to Re^2: Looping through database query to send emails is taking too long
by htmanning
in thread Looping through database query to send emails is taking too long
by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |