title: Showing search engine result horizontally using css in html
body: <p>I have created a search engine for my website and it is successfully importing the data. But the searched images are appearing vertically and I want them to appear two images per row. Below are my code and image of search results.</p>
  
  <p><img src="https://i.stack.imgur.com/UMrgy.png" alt="enter image description here"></p>
  
  <pre><code> &lt;?php
  
   $connection = new mysqli("localhost", "root", " " , "grand_database");
  
   if($connection -&gt; connect_error){
  
       die("Connection Failed : ". $connection-&gt; connect_error );
   }
  
  if(isset($_GET['keyword'])){
      error_reporting(E_ALL);
  
      $keyword = $_GET['keyword']; 
  
          $min_length = 3;
  
              global $i;
  
  
              if(strlen($keyword) &gt;= $min_length){ // if query length is more or equal minimum length then
  
      $keyword = htmlspecialchars($keyword);
  
              $explosion = explode(" " , $keyword);
  
              $query = "SELECT title , link , image , description FROM search WHERE " ;
  
                  foreach($explosion as $exploded_keyword){
  
                      $i++;
  
                      if($i == 1)
  
                          $query.= "keywords LIKE '%$exploded_keyword%' " ;
  
                      else
                          $query.= "OR keywords LIKE '%$exploded_keyword%' ";
  
                  }
  
           $result = $connection -&gt; query($query);
  
        if($result -&gt; num_rows &gt; 0){ // if one or more rows are returned do following
  
          echo "&lt;div class = 'container'&gt;
  
                  &lt;h3&gt;You Searched For: $keyword&lt;/h3&gt;&lt;br&gt;&lt;h4&gt;If you are not getting the desired results, please check your spellings or try different Search.
  
                  &lt;/div&gt;";
  
          echo '&lt;hr&gt;';
  
           while($row = $result-&gt; fetch_assoc()){
  
                  $title = $row['title'];
                  $link = $row['link'];
                  $image = $row['image'];
                  $description = $row['description'];
  
  
                  echo "&lt;div class= 'container'&gt; 
  
                  &lt;div class= 'row'&gt;
  
      &lt;div class= 'col-sm-4'&gt;
  
          &lt;img src= '$image' class= 'img-responsive thumbnail' style= 'width: 300px;'/&gt;
  
          &lt;h4&gt;&lt;a href= '$link' target= '_blank'&gt;$title&lt;br&gt;&lt;/a&gt;&lt;/h4&gt;
          &lt;h5&gt;$description&lt;/h5&gt;&lt;hr&gt;
  
      &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class= 'container' style= 'height: 100px;'&gt;&lt;/div&gt;";
           }
  
  
      }
      else{ // if there is no matching rows do following
          echo "&lt;div class= 'container'&gt;&lt;h3&gt;No Results Found&lt;/h3&gt;&lt;br&gt;&lt;h4&gt;Plese check your spellings or try different keyword&lt;/h4&gt;&lt;/div&gt;";
      }
  
  }
      else{ // if query length is less than minimum
          echo "&lt;div class= 'container'&gt;&lt;h3&gt;No result found!&lt;/h3&gt;&lt;br&gt;&lt;h3&gt;Minimum length is $min_length&lt;h3&gt;&lt;br&gt;
  
              &lt;h3&gt;Please enter the keyword, more than 3 characters.
          &lt;/div&gt;";
      }
  
  }
  
  $connection-&gt; close();
  </code></pre>
  
  <p>?></p>