Hi all,

I posted about this late yesterday and got some help, but I am really stuck now. I need to display my results to the web using PHP.

Here is my query:

SELECT p.lname,p.fname,p.degree1,p.degree2,p.degree3,
    w.web_link,
    a.dra_id,
    dra.area,
    t.title,
    id.interest_id,
    i.interest_type
FROM tbl_personnel p
LEFT JOIN tbl_personnel_weblinks w ON p.id = w.person_id
LEFT  JOIN tbl_personnel_dras a ON p.id = a.person_id
LEFT  JOIN tbl_dra dra ON a.dra_id = dra.id
LEFT  JOIN tbl_personnel_interests id ON p.id = id.person_id
LEFT  JOIN tbl_interest_types i ON id.interest_id = i.interest_type_id
LEFT  JOIN tbl_personnel_titles t ON p.id = t.person_id
 ORDER BY p.id

The problem I am having is that tbl_personnel has a one to many relationship with tbl_personnel_dras and also tbl_personnel_interestes AND tbl_personnel_dras and tbl_personnel_interests need to get their displayable names from tbl_dra and tbl_interest_types (respectively).

I am ok with simple joins and stuff (and maybe not so simple ones) but I just can't get this to work. The data I get back from this is to have one record returned for every variation. I spent the day trying to figure out how to pull it apart in PHP and get it to display properly (without any luck) BUT I am sure this can be done in MySQL and probably a lot easier.

Anyone able to help me with this?

Thanks in advance,
Charles


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to