I have following tables:
Sender
---------
ID, name, type, mobile
Receiver
-----------
ID, name, type, mobile
Ports
-----------
ID, name, city, country
Shipment
-----------
ID, Sender_ID, Receiver_ID, From_Port_ID, To_Port_ID, Date, Status
I was trying to display shipment table contents in my webpage with names instead of IDs. I can fetch sender and receiver name by the following query:
SELECT sender.name AS Sender, receiver.name AS Receiver, shipment.id
FROM sender,receiver,shipment
WHERE shipment.sender_ID=sender.ID AND shipment.receiver_ID=receiver.ID
How to fetch port names from ports table?