View Full Version : Jobs by Email

08-20-2007, 10:24 PM
i am working on a basic job site for a friend he has a mysql database with users that have a profile, in the profile they select the job type and county and also if another user adds a job they also adds a job type and a county.

i need some help on the part where if the user adds the job with lets say bricklayer as the type the other user/s with the job type bricklayer in there profile will be emailed the job that was just posted.

but the user also has selected the county of yorkshire etc

so the user has selected bricklayer and yorkshire ( both are in a mysql database ) and the other user has just added a bricklaying job in yorkshire, the email is sent, the user must activate this feature - email alert on or off etc

so only if the user selected job and county they will get the job alert

any ideas



08-20-2007, 10:39 PM
Nothing you've described is difficult, which part specifically are you having trouble with?

08-21-2007, 08:55 AM
that answer sounds good :) - ok how do i check the users profile and match it with the new job that has been posted then send the email..

the sql table for the job seeker is job_seeker_profile and the rows containing for info are job_seeker_name , job_seeker_email , job_category and job_seeker_state.

the sql table for the jobs posted is job_post and the rows that need to match are job_category and job_seeker_state.

so when the posted job_category and job_seeker_state match the job seekers job_category and job_seeker_state, the email job_seeker_email will be sent with the link to the job that was posted, please note that the job seeker is allowed to select more than one job_category

i am stuck on the whole idea tbh - newbie with his head full :o



08-21-2007, 12:41 PM
How do the multiple categories get stored in the jobseeker table?

08-21-2007, 08:34 PM
the jobs are added to the same row :

job1 - job2 - job3 etc

08-21-2007, 09:06 PM
Is there a limit to the number of categories a job_seeker can be in?

It might be worthwhile to separate that out in to another table (seeker_categories) or something. That way, they can select as many as they want.

Then, when a new job is inserted, your SQL query will be something like:

SELECT * FROM job_seeker as seeker
LEFT JOIN job_category as category ON seeker.id = category.id
WHERE category.job_category = {$newJobCategory} AND seeker.send_email = 1

That should give you the results you're looking for. I think. My SQL sometimes requires a few test to work right... :rolleyes: