$SQL = "Select * from database where active='yes' AND (TO_DAYS(NOW())- +TO_DAYS(dateadded) < 1)"; #check for records created today &Do_SQL; while ($pointer = $sth->fetchrow_hashref) { $jobtype = $pointer->{'jobtype'}; $toemail = $pointer->{'email'}; $SQL3 = "Select * from database where jobtype='$jobtype' A +ND active='yes' ORDER BY RAND() LIMIT 5"; &Do_SQL3; while ($pointer3 = $sth3->fetchrow_hashref) { $contact= $pointer3->{'contact'}; $jobnum= $pointer3->{'jobnum'}; $picture = $pointer3->{'picture'}; $my_job = "<tr><td style=\"width:60px;padding:0;\">$pictur +e - <a href=\"/get-job.pl?jobnum=$jobnum\">$contact</a></td></tr>"; } } open (MAILHTML, "|$sendmail $toemail") || die "Can't open $sendmail!\n +"; print MAILHTML "From: Admin <admin\@admin.com>\n"; print MAILHTML "Reply-to: Admin <admin\@admin.com>\n"; print MAILHTML "To: $toemail\n"; print MAILHTML "Subject: Recommended Jobs\n"; print MAILHTML "Content-Type: text/html\n"; print MAILHTML "$my_job"; close (MAILHTML);
In reply to More loop issues by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |