title: php output from mysql to html table
body: <p>currently I'm working on a site uptime search engine however I'm having a silly issue. I want to output more than one mysql row in a table however my code below causes a separate table to be created for each  row thats found. Thank you in advance for your assistance
          
  
  <pre><code> $searchTerm = trim($_GET['searchterm']);
  
   //check whether the name parsed is empty
   if($searchTerm == "")
  {
  echo "Please enter something to search for...";
  exit();
  } 
  
  //database connection info
  $host = "localhost"; //server
  $db = "DB NAME"; //database name
  $user = "USER"; //dabases user name
  $pwd = "PASSWORD"; //password
  
  
  $link = mysqli_connect($host, $user, $pwd, $db);
  
  
   $query = "SELECT * FROM sites WHERE name OR des LIKE '%$searchTerm%'";
  
   $results = mysqli_query($link, $query);
  
  
   if(mysqli_num_rows($results) &gt;= 1)
   {
  
  while($row = mysqli_fetch_array($results))
  {
  echo '&lt;table class="table table-striped table-bordered table-hover"&gt;'; 
  echo"&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Description:&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;/TR&gt;"; 
  echo "&lt;tr&gt;&lt;td&gt;"; 
  echo $row['name'];
  echo "&lt;/td&gt;&lt;td&gt;";   
  echo $row['des'];
  echo "&lt;/td&gt;&lt;td&gt;";    
  echo $row['status'];
  echo "&lt;/TD&gt;&lt;/tr&gt;";  
  echo "&lt;/table&gt;";    
  }
  
      }
      else
  echo "There was no matching record for the name " . $searchTerm;
  ?&gt;
  </code></pre>