title: php wont echo results from inner join query
body: <p>I've looked around the site for similar problems with solutions and non seem to fix the problem I have. I have two tables; "friendlist" and "users". I'm trying to use the "FriendID" from "friendlist" to retrieve information from the "users" table. Everything works fine up until the <code>while($row = mysqli_fetch_array($result)){}</code> loop then nothing else prints. </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>$query = "SELECT friendlist.FriendID, users.Name, users.Surname, users.Picture 
                  FROM friendlist            
                  INNER JOIN users
                  ON friendlist.FriendID = users.Id
                  WHERE friendlist.UserId ='".$id."'";
  $result = mysqli_query($con, $query);
  
  if(!$result){
      echo "&lt;br/&gt;&lt;h4&gt;You currently do not have any friends. Please click the Find Friends button to find a friend&lt;/h4&gt;";
  }else{
      echo "&lt;center&gt;&lt;br/&gt;Here is a list of all your friends:&lt;br/&gt;";
      echo "&lt;table&gt;";
      while($row = mysqli_fetch_array($result)){
          echo "&lt;tr&gt;";
          echo "&lt;td&gt;Pro Pic: &lt;img style='width:200px; height:200px' alt='No Profile Picture' src='uploads/" .$row['Picture']. "' /&gt;&lt;/td&gt;";
          echo "&lt;td&gt;Name :" .$row['Name']. "&lt;/td&gt;";
          echo "&lt;td&gt;Surname :" .$row['Surname']. "&lt;/td&gt;";
          echo "&lt;td&gt;&lt;form method='post' action='viewFriend.php'&gt;";
          echo     "&lt;input type='hidden' name='friendId' value='".$row['FriendID']."'/&gt;";
          echo     "&lt;input type='submit' name='View' value='View Profile'/&gt;";
          echo "&lt;/form&gt;&lt;/td&gt;";
          echo "&lt;/tr&gt;";
      }
      echo "&lt;/table&gt;&lt;/center&gt;";
  }
  </code></pre>
  
  <p>Nothing is displayed on the browser. Only the level 4 heading text: "Here is a list of all your friends" shows. But after that its empty space.<br>
  I've checked the sql query on mySql and it works perfectly fine. I have no idea what's wrong. Any help will be much appreciated. Thanks</p>