I have the following problem.
I'm setting up a classifieds section on a website for jobs.
When a job is posted, i need all registered applicants looking for a job that a new job matching their criteria has been posted.
I got that to work ok, to some extent.
All applicants get notified that a new job matching their criteria has been posted.
The problem i have is as follow:
An employer can post up to 10 jobs at one time, then pay, and THEN the notification emails to applicants are triggered.
What i cant find out is:
I can get one email sent to each job seeker saying that one job has been posted matching their criteria,
but if 5 jobs have been posted by the same employer, matching their criteria, I cannot get 5 emails with each job reference number sent to each applicant.
Damn! I hope this makes any sense..
Basically, I would need the line:
$jobtype = $row_rs_emploeyr_emails['PDid'];
to also be looped, although it comes from a different recordset.
I guess I'm very lucky if anyone understand any of this and can help...
mysql_select_db($database_to_octo, $to_octo);
$query_rsmother_notices = "SELECT * FROM cv WHERE cv.job_type='".$row_rs_emploeyr_emails['job_type']."' ";
if ($result = mysql_query ($query_rsmother_notices) )
while ($row = mysql_fetch_assoc($result)) {
$email = $row['email'];
$companyname = $row['companyname'];
$jobtype = $row_rs_emploeyr_emails['PDid'];
// send email
mail( "$email", "New job on has been posted",
"
Dear $name,
A new job $jobtype has been posted which could be of interest to you", "From: jobs@joboffers.com" );
}
mysql_query($query_rsmother_notices) or die(mysql_error());
Many thanks,
Vinny