maliary Posted May 4, 2007 Share Posted May 4, 2007 Hi, I have a problem here that i would like you to help me out with. I have got 5 tables. a.)person b.)encounter c.)chem test d.)bacterial test e.)pathological test the 3 test tables c,d,e and the encounter table b all have encounter values. The person table has person details like name etc tables c,d and e contain diffrent tests.The encounter table also has a person id (pid) which matches with the person id in the person table to get the person's details. The encounter number in the test table matches with the encounter number in the encounter table which then matches with the pid in the same table to match with the pid in the person table and get the person details. The logic may not be correct but I would like to make a query that displays the results for people with test data.How would I get around this? this is what i have so far which is not working... SELECT * FROM $tb_find_chemlab AS f,$tb_find_baclabor AS h,$tb_find_patho AS g LEFT JOIN $this->tb_enc AS e ON e.encounter_nr = f.encounter_nr AND e.encounter_nr = h.encounter_nr AND e.encounter_nr = g.encounter_nr LEFT JOIN $this->tb_person AS p ON p.pid = e.pid Link to comment https://forums.phpfreaks.com/topic/49977-display-help-needed/ Share on other sites More sharing options...
Barand Posted May 4, 2007 Share Posted May 4, 2007 DON'T double post! Link to comment https://forums.phpfreaks.com/topic/49977-display-help-needed/#findComment-245369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.