Jump to content

Display help needed


maliary

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.