Hi folks I'm learning how to code (php and mysql) by following online tutorials and am building my first website from scratch.
I am stumped with a problem and I don't know the best search keywords to get results in google. I hope someone can help.
I am familiar with the
SELECT ... FROM ... JOIN ... ON ...
and it works really nicely when working with directly related tables but when a table is ... 'distant related' (I don't know how to phrase this) then I get an error in mysql.
Please see the image below. https://i.sstatic.net/mfNXT.png I have 5 tables.
I want to output a html table using code similar to
"SELECT horseRaces.ID, horseRaces.stall, horseRaces.draw, horses.name, horses.birth, horseRaces.win, horseRaces.place, horseStatus.name
FROM horseRaces
JOIN horses ON horseRaces.horseID = horses.ID
JOIN horseStatus ON horseRaces.horseStatusID = horseStatus.ID
ORDER BY stall"
Hope someone can help me because I'm stumped. All my google searches brings inner join and outter join results.