title: How to select all data from three tables with a foreign key
body: <p>Hi i am trying to select all data from three tables with a foreign key. i have tried something like that</p>
  
  <pre><code>$getId = $_GET['id'];
  
  $getAll="SELECT * FROM employee_info ,over_view, employee_attendance
  WHERE employee_info.id=$getId AND id=over_view.id AND id=employee_info.id";
  $info_data = $dbcon-&gt;query($getAll);
  $store = $info_data-&gt;fetch(PDO::FETCH_ASSOC);
  echo $store['first_name'];
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/swL9T.png" rel="nofollow">but it shows that error</a> ans as a newbie i am finding it hard to solve.
  now how can i select all the data with a single query from three table over_view and employee_attendance tables id's are foreign key of employee_info.</p>