title: PHP - how to display information from specific member from the other table in mysql
body: <p>Good Day GURUS!</p>
  
  <p>I know my sounds indifference but I will try to elaborate as much as I can. I will just want to ask how could I display an information from John Doe (member table) with the other table (ex. book_information). Assuming that there are lot of members in the database the likes of Juan Doe, James Doe and more but I would like to display the information of books which borrowed by John Doe. Sample Illustration is below:</p>
  
  <p>Name: John Doe
  Address: Fairy Land
  Contact: 225-659</p>
  
  <p>Borrowed Book Information:</p>
  
  <h2>Book Title | Author  | ISBN       | Date Borrowed   | Action</h2>
  
  <p>Snow White | Mr Snow | 02-999898  | 09-15-2015      | RETURNED?
  The Naked  | G. Bell | 02-910031  | 09-21-2015      | RETURNED?</p>
  
  <p>View Profile Codes</p>
  
  <pre><code> &lt;div class="container"&gt;
      &lt;div class="margin-top"&gt;
          &lt;div class="row"&gt;   
              &lt;div class="span12"&gt;        
          &lt;?php $get_id = $_GET['id']; ?&gt;
  
          &lt;?php 
          $query=mysql_query("select * from member where member_id='$get_id'")or die(mysql_error());
          $row=mysql_fetch_array($query);
  
  ?&gt;
  
              &lt;div class="alert alert-info"&gt;&lt;strong&gt;Viewing Profile&lt;/strong&gt; of &lt;?php echo $row['firstname']." ".$row['lastname']; ?&gt;&lt;/div&gt;
  
              &lt;p&gt;&lt;?php echo $row['badge']; ?&gt;.jpg" width="90" height="90"&gt;&lt;/p&gt;
              &lt;p&gt;Name: &lt;strong&gt;&lt;?php echo $row['firstname'].", ".$row['lastname']; ?&gt;&lt;/strong&gt;&lt;/p&gt;
              &lt;p&gt;Address: &lt;strong&gt;&lt;?php echo $row['address']; ?&gt;&lt;/strong&gt;&lt;/p&gt;
              &lt;p&gt;Contact: &lt;strong&gt;&lt;?php echo $row['contact']; ?&gt;&lt;/strong&gt;&lt;/p&gt;
              &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
              &lt;p&gt;&amp;nbsp;&lt;/p&gt;
              &lt;p&gt;Borrowed Book Information:&lt;/p&gt;
  
              &lt;p&gt;
  
              &lt;table cellpadding="0" cellspacing="0" border="0" class="table" id="example"&gt;
  
                              &lt;thead bgcolor="#000000" style="color:#ffffff"&gt;
                                  &lt;tr&gt;
                                      &lt;th&gt;Book Title&lt;/th&gt;
                                      &lt;th&gt;Author&lt;/th&gt;                                 
                                      &lt;th&gt;ISBN&lt;/th&gt;                                 
                                      &lt;th&gt;Date Borrowed&lt;/th&gt;                                 
                                      &lt;th&gt;Action&lt;/th&gt;
                                  &lt;/tr&gt;
                              &lt;/thead&gt;
                              &lt;tbody&gt;
  
              &lt;?php  $user_query=mysql_query("select * from borrow
                              LEFT JOIN member ON borrow.member_id = member.member_id
                              LEFT JOIN borrowdetails ON borrow.borrow_id = borrowdetails.borrow_id
                              LEFT JOIN book on borrowdetails.book_id =  book.book_id 
                              where borrowdetails.borrow_status = 'pending'ORDER BY borrow.borrow_id DESC
                                ")or die(mysql_error());
                                  while($row=mysql_fetch_array($user_query)){
                                  $id=$row['borrow_id'];
                                  $member_id=$row['member_id'];
                                  $book_id=$row['book_id'];
                                  $borrow_details_id=$row['borrow_details_id'];
  
                                  ?&gt;
                                  &lt;tr class="del&lt;?php echo $id ?&gt;"&gt;
  
  
                                  &lt;td&gt;&lt;?php echo $row['book_title']; ?&gt;&lt;/td&gt; 
                                  &lt;td&gt;&lt;?php echo $row['author']; ?&gt; &lt;/td&gt;
                                  &lt;td&gt;&lt;?php echo $row['isbn_no'];?&gt;&lt;/td&gt;
                                  &lt;td&gt;&lt;?php echo $row['date_borrow'];?&gt;&lt;/td&gt;
                                  &lt;td&gt; &lt;a rel="tooltip"  title="Return" id="&lt;?php echo $borrow_details_id; ?&gt;" href="#delete_book&lt;?php echo $borrow_details_id; ?&gt;" data-toggle="modal"    class="btn btn-success"&gt;&lt;i class="icon-check icon-large"&gt;&lt;/i&gt;Return?&lt;/a&gt;
                                  &lt;?php include('modal_return.php'); ?&gt;
                                  &lt;td&gt;&lt;/td&gt; 
  
                                  &lt;/tr&gt;
                                  &lt;?php  }  ?&gt;
  
              &lt;/p&gt;       
  
  
  
              &lt;p&gt;&lt;a class="btn btn-info" href="member.php"&gt;&lt;i class="icon-arrow-left icon-large"&gt;&lt;/i&gt;&amp;nbsp;Back&lt;/a&gt;&lt;/p&gt;
              &lt;/div&gt;  
  </code></pre>
  
  <p>Please help because I can't figured out (just a beginner though). I'm stuck on it.
   Thanks in advance.</p>