title: while($row = mysqli_fetch_array($result)){ when selection multiple tables
body: <p>I'm creating this  search function with PHP, javascript and mysql.</p>
  
  <p>This code is working like it should. I type in some data in a a html search box, which sends the %keyword% to this PHP function, which returns the data as I want.</p>
  
  <pre><code>$query = "SELECT id,fornavn,efternavn,adresse,postnr,city,tlf,kon,email,fodselsdag FROM kunde WHERE email LIKE '%$keyword%' OR fornavn LIKE '%$keyword%'";
  
  
  $result = mysqli_query($dbc,$query);
  
  if($result){
      if(mysqli_affected_rows($dbc)!=0){
        while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
          listings($row['fornavn'],$row['efternavn'], $row['email'],$row['adresse'],$row['tlf'],$row['postnr'],$row['city'],$row['fodselsdag'],$row['id'],$bartype);
      }
  </code></pre>
  
  <p>I have another TABLE where the id from the SQL above is stored in relation to another ID. The table looks like this:</p>
  
  <pre><code>Table name: vip
  Colmns: id, brugerid, barid
  </code></pre>
  
  <p>Now I want to be customize the SQL in the code above, so it only picks data that also has a relation in the vip table.</p>
  
  <p>I do it this way:</p>
  
  <pre><code>SELECT *, kunde.id as kundeid FROM kunde,vip WHERE  vip.brugerid = kunde.id AND vip.barid =1 AND email LIKE '%$keyword%' OR fornavn LIKE '%$keyword%';
  </code></pre>
  
  <p>Actually whenever I add more than one table, the php code stops working..  any idea why this is happening? And how I can achieve this? </p>
  
  <p>Any help will be very appreciated </p>