This topic is locked

How would I email someone with data from multiple tables?

12/18/2010 11:27:14 PM
PHPRunner General questions
K
karmacomposer author

I have 3 tables with different info. I need a user to press a button which would then email a chosen person data from these several different tables.
How would I do this?
Mike

Sergey Kornilov admin 12/19/2010

Sure, you need to use JOIN SQL query that can pull data from several tables at once.
More info:

http://www.tizag.com/sqlTutorial/sqljoin.php

K
karmacomposer author 12/19/2010



Sure, you need to use JOIN SQL query that can pull data from several tables at once.
More info:

http://www.tizag.com/sqlTutorial/sqljoin.php


I read that article. Very interesting and informative. I have set up the three tables I need in the join and selected those fields necessary for the join.
I attempted an inner join, but I really do not have a equal field for all three to share. I would like to leave the CandidateCC and CandidateSWT tables alone since adding a new field to them would be a massive headache. However, it is the EMPLOYER that is initiating the email. The Employer offers a job to a candidate and the button sends the candidate an email letting them know there is a job offer for them and the email also has the employer and job offer information. The three tables are Employer, EmployerJobs and CandidateCC.
Do I need a matching ID field in all three tables to join them? If so, how does that work?
Mike

Sergey Kornilov admin 12/20/2010

There is a whole lot of examples of joining multiple tables on the Internet:

http://www.google.com/search?q=sql+join+multiple+tables&ie=utf-8&oe=utf-8&aq=t&client=firefox-a&rlz=1R1GGGL_en