title: Inner join and PDO
body: <p>I have a problem with INNER JOIN and PDO. My query is working just fine when not using INNER JOIN. When adding INNER JOIN to the query nothing shows. </p>
  
  <p>Is this a way to go or am I completely wrong? </p>
  
  <p>Any suggestions?</p>
  
  <pre><code>public function search($searchterm)
  {
      $query = $this-&gt;db-&gt;prepare("
          SELECT 
              ad.id AS idet,
              ad.lid, 
              ad.firstname AS firstnamer, 
              ad.surname AS surnamer,
              ad.socialnr AS socialnumber,
              ba.class AS classes
          FROM `everybody` ad
          INNER JOIN `students` ba
          ON idet = ba.id
          WHERE (`firstname` LIKE :search OR `surname` LIKE :search OR `classes` LIKE :search)");
  
      $searchterm = '%' . $searchterm . '%';
      $query-&gt;bindParam(':search', $searchterm, PDO::PARAM_STR);
  
      $query-&gt;execute();
  
      while($row = $query-&gt;fetch(PDO::FETCH_ASSOC)) {
        echo $row['idet']. ' : '. $row['firstnamer']. ' '. $row['surnamer']. ' - '. $row['socialnumber']. ' Class: '. $row['classes']. '&lt;br /&gt;';
      }
  
  }
  </code></pre>