
Originally Posted by
Banana Man
The best option is probably to sit down and learn how to write more complex MySQL queries, option 2 is to add more direct relational fields to my tables but then i am duplicating content, or the third option is to break down my MySQL queries into a few straight forward PHP queries.
for sure the first option is best... option 2 is horrible, and option 3 works real well occasionally but will often be lacking in performance

Originally Posted by
Banana Man
In the example below i am trying to print the table_1_title but only when the table_3_country is set to 'ireland' for example.
a simple join will do it
Code:
SELECT table1.table_1_id
, table1.table_1_title
FROM table1
INNER
JOIN table2
ON table2.table_2_id = table1.FK_table_2_id
INNER
JOIN table3
ON table3.table_3_id = table2.FK_table_3_region
AND table3.table_3_country = 'ireland'
Bookmarks