Trying to select data from up to eight tables, with the common column being the file_id column.
Cutting the query down to just three columns I am using:
$query = "SELECT *
FROM tbl_name,
tbl_branch,
tbl_details
WHERE tbl_name.file_id = tbl_branch.file_id AND
tbl_name.file_id = tbl_details.file_id";
I'd take a guess that's this a fairly clumsly query, but the trouble I'm having is that not all the results are being listed. I gather that this is because although there are 20 file_id's in the tbl_name, not all the other tables are complete....so tbl_branch only has 15 entries, and tbl_details only 12.
So two questions.....
Is there a better way to structure the query???
And can I have results appear as 'blank' if there is an entry in tbl_name but no linked entry in tbl_branch?? If so... any clues?
Muchly appreciate any help 'cause a little clueless (and clearly struggling!)
Thanks