title: How to display search results in a table in PHP
body: <p>I am busy with a simple html/php script and all I want to do is display the results I search for from my database in a table form but nothing is showing.
  Here is my code:</p>
  
  <pre><code>    &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;product sales for a specific customer&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt;
      &lt;/head&gt;
      &lt;body&gt;
              &lt;h3 align="center"&gt; Please Search for a specific customer you want to see sales for: &lt;/h3&gt;
              &lt;br /&gt;
              &lt;input type="text" name="txtNameSearch" /&gt;
              &lt;input class="src_btn" type="submit" name="btnSearch" value="Search" /&gt;
                  &lt;table width="800" border="1" cellpadding="1" cellspacing="1"&gt;
                  &lt;tr&gt;
                  &lt;th&gt;Order Details Id&lt;/th&gt;
                  &lt;th&gt;Order ID&lt;/th&gt;
                  &lt;th&gt;Product Id&lt;/th&gt;
                  &lt;th&gt;Login ID&lt;/th&gt;
                  &lt;th&gt;Quantity&lt;/th&gt;
                  &lt;th&gt;Product Price per unit&lt;/th&gt;
                  &lt;th&gt;Product Name&lt;/th&gt;
                  &lt;th&gt;Product Descrp&lt;/th&gt;
                  &lt;th&gt;Genre&lt;/th&gt;
                  &lt;th&gt;Price&lt;/th&gt;
                  &lt;th&gt;Quantity Sold&lt;/th&gt;
                  &lt;/tr&gt; 
  &lt;?php
  if(isset($_POST["btnSearch"]))
  {
  $connection = mysqli_connect('localhost', 'root', '', 'bookstore');
  $sql="SELECT * FROM order_details right join tblproduct on order_details.prod_id=tblproduct.prod_id WHERE id_login = $search";
  $Joined_records=mysqli_query($connection,$sql);
  
  if (isset($_POST['txtNameSearch'])){
      $search = $_POST['txtNameSearch'];
  }
  while ($row=mysqli_fetch_assoc($Joined_records)){
      echo"&lt;tr&gt;";
      echo"&lt;td&gt;".$row["order_details_id"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["order_id"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_id"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["id_login"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["quantity"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["price_per_unit"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_name"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_descr"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_cat"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_price"]."&lt;/td&gt;";
      echo"&lt;td&gt;".$row["prod_quan"]."&lt;/td&gt;";
      echo"&lt;/tr&gt;";
  
  }
  }
  
  ?&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So what I want to do is for instance I type "3" in the search bar and I click submit I want all the values corresponding with that 3 in my database to display in a table form.</p>