I'm trying to pull information from three different tables.
Table one is Monthly Ship Reports- where every report has a key to both the ship, and the officer.
Table two is the Ships Table, which has the ship's name.
Table three is the officers table, which has the officer's name.
SELECT ship_monthly_report.*,
ships.ship_name,
officers.officers_title,
officers.first_name,
officers.last_name
WHERE report_key = '" . $_POST["monthly_report_ID"] .
"LEFT JOIN Ships
ON Ship_Monthly_Report.Ship_ID = Ships.Ship_Primary_Key
LEFT JOIN Officers
ON Ship_Monthly_Report.Capt_ID = Officers.Officers_PK
ORDER BY report_line_number ASC
is the query I wrote.. which returns null. This is in a PHP script.
I guess what I'm asking is, can I do this? all the fields are correct. Am I butchering the query or am I trying to do something that is impossible?