title: Search button not displaying specific data on the table
body: <p>I have 4 rows of data in the table. I managed to display all the data using PDO select query. I also have a search button for displaying specific data from my database. It's working but instead of filtering and displaying the specific data I have searched, it just added on the table.
  Here is my code for search button:</p>
  
  <pre><code>if(isset($_POST['search_btn']))
  {
  $row = null;    
  if(empty($_POST['InvNumbTxt']))
  {
  echo '&lt;h3&gt;*Please input invoice number!&lt;/h3&gt;';
  }
  else
  {
  $invtxt = $_POST['InvNumbTxt'];
  $dbh=db_connect();         
  $sql1="SELECT * FROM invalid_invoice WHERE Invoice_Number='".$invtxt."'";
  $stmt1=$dbh-&gt;prepare($sql1);    
  $stmt1-&gt;execute();
  
  while( $row2 = $stmt1-&gt;fetch(PDO::FETCH_ASSOC) ) { ?&gt;
  
  
  &lt;td&gt;&lt;?php echo $row2['Issue_Type']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Creation_Date']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Site']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Vendor_Name']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Invoice_Date']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Invoice_Number']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Part_Number']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['PO']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['RR']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Currency']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Invoice_Amount']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Issues']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['PersoninCharge']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['PIC_Comments']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['Status']; ?&gt;&lt;/td&gt;
  &lt;td&gt;&lt;?php echo $row2['ID']; ?&gt;&lt;/td&gt;
  
  &lt;?php
  }  
  ?&gt;
  &lt;/tr&gt; 
  &lt;?php  
  $dbh = null;
   }
  }
  ?&gt;
  </code></pre>
  
  <p>Here is the code for displaying the data on the table:</p>
  
  <pre><code>$invtxt = $_POST['InvNumbTxt'];
  $dbh=db_connect();         
  $sql="SELECT * FROM invalid_invoice";
  $stmt=$dbh-&gt;prepare($sql);  
  $stmt-&gt;execute();
  
  echo "&lt;form name='update' method='POST'&gt;&lt;tr class=output2&gt;";
  
  while($row =$stmt-&gt;fetch(PDO::FETCH_ASSOC)) { 
  
  echo "&lt;td&gt;".$row['Issue_Type']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Creation_Date']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Site']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Vendor_Name']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Invoice_Date']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Invoice_Number']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Part_Number']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['PO']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['RR']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Currency']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Invoice_Amount']."&lt;/td&gt;";
  echo "&lt;td&gt;".$row['Issues']."&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='pic' value='".$row['PersoninCharge']."'&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='comt' value='".$row['PIC_Comments']."'&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='stat' value='".$row['Status']."'&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='submit' name='save_btn' value='&amp;diams; SAVE &amp;diams;' style='font-size:1em;'/&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='hidden' name='idtxt' value='".$row['ID']."'/&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;"; 
  } 
  echo "&lt;/form&gt;";
  
  $dbh=null;
  &lt;tr class=output2&gt;
  &lt;?php
  </code></pre>