title: Fetch just some values in database using PHP and MySQL
body: <p>I want to print only the booktitle and publisher without similar booktitle from my other table.</p>
  
  <pre><code>while($row_result_kinder1_comp_lit = mysqli_fetch_array($sql_result_kinder1_comp_lit)) {
              $fetched1 = $row_result_kinder1_comp_lit[3]; //fetch booktitle column from       $sql_result_kinder1_comp_lit //
              echo $fetched1;
          }
              while($row_kinder1_comp_lit = mysqli_fetch_array($sql_kinder1_comp_lit)) {
              $fetched2 = $row_kinder1_comp_lit[1]; //fetch booktitle column column from       $sql_kinder1_comp_lit //
          if($fetched1 != $fetched2) {
       echo $row_kinder1_comp_lit['booktitle'];
       echo $row_kinder1_comp_lit['publisher'];
      }
  } 
  </code></pre>
  
  <p>the problem is the $fetched1 inside if statement only get the value of the last row in my database. So it hide only the book in the $sql_kinder1_comp_lit with the same booktitle in the last row of my $result_sql_kinder1_comp_lit;</p>
  
  <pre><code>my table $sql_kinder1_comp_lit is
  id    booktitle    publisher
  1     book1        publisher1
  2     book2        publisher2
  3     book3        publisher3
  
  my table $sql_result_kinder1_comp_lit is
  id    booktitle    publisher
  1     book1        publisher1
  2     book2        publisher2
  </code></pre>
  
  <p>I want to display only the book3 because it doesnt have the same booktitle from the other table.</p>