title: div inside while loop in php
body: <p>The search results should display like this <a href="https://i.stack.imgur.com/2FR6h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2FR6h.png" alt="enter image description here"></a></p>
  
  <p>But my results are stacking on top of each. <a href="https://i.stack.imgur.com/Ahky2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ahky2.png" alt="enter image description here"></a></p>
  
  <p>Here is my code :</p>
  
  <pre><code>&lt;div class="container"&gt;
  
  &lt;?php
      mysql_connect("localhost", "root", "") or die(mysql_error());
      mysql_select_db("thesis") or die(mysql_error());
  
      $search = trim( $_POST['SearchKeywords']);
  
      $query = " SELECT * FROM new_data WHERE Product_Title or Product_link LIKE'%$search%' "; 
  
      $sql = mysql_query($query) or die(mysql_error());
      $count = mysql_num_rows($sql);
  
      $count == 0;
  
      if ($count == 0) {
  
          echo "Sorry, Nothing Found !!";
  
      }else{
  
      while ($row = mysql_fetch_array($sql)) 
      {
          $img = $row ['Product_Img'];
          $link = $row ['Product_link'];
          $title = $row ['Product_Title'];
          $price = $row ['Product_Price'];
  ?&gt;
  
  &lt;div class="card"&gt; 
    &lt;div class="front alert alert-success"&gt; 
      &lt;?php echo "$title"; 
           echo "&lt;img src='$img' width='80px' height='100px'&gt;"; 
           echo "$price"; ?&gt; 
    &lt;/div&gt; 
  &lt;/div&gt;
  &lt;?php
       };
      };
  ?&gt;
  &lt;/div&gt;  &lt;!-- Container --&gt;
  </code></pre>
  
  <p>Those <strong>div</strong> blocks are inside a <strong>container</strong>. 
  I added a bootstrap class in order for better a design. </p>