title: Fetching data from table 1 using table 2
body: <p>I have 2 tables as follows:</p>
  
  <p>phpvms_airports
  <a href="https://i.stack.imgur.com/xQKvN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xQKvN.png" alt="phpvms_airports"></a></p>
  
  <p>phpvms_schedules
  <a href="https://i.stack.imgur.com/zDH0G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zDH0G.png" alt="phpvms_schedules"></a></p>
  
  <p>Icao on the first table is a HUB I need to find destinations for each HUB in table 1, from table 2 and find their lat and lng in table 1. Now here is the query that I have:</p>
  
  <pre><code>SELECT DISTINCT icao, arricao, lat, lng 
  FROM phpvms_airports 
      LEFT JOIN phpvms_schedules ON icao = depicao 
  WHERE hub = 1
  </code></pre>
  
  <p>And here is what I get:</p>
  
  <p><a href="https://i.stack.imgur.com/fLdRJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fLdRJ.png" alt="Results"></a></p>
  
  <p>The problem is that I get lat, lng for the hubs instead of the destinations.
  Please help me!</p>
  
  <p>Thanks</p>