title: How to echo a specific content after fetching 4 rows in MySQL database
body: <p>I am making a backend system, and the displayed product from the index page should follow the grid system. For example, I have 8 products from MySql database. I want to divide them into 2 rows, 4 products each. So my PHP code would look like:</p>
  
  <pre><code>&lt;div class="row"&gt;
  &lt;?php
  $result = mysqli_query($conn, "SELECT * FROM products");
  while ($row = mysqli_fetch_array($result)) {
  ?&gt;
  &lt;div class="col-dsk-4"&gt;&lt;?php echo $row["name"]; ?&gt;&lt;/div&gt;
  &lt;?php
  }
  ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see in the code, I want after echoing 4 times (4 times <code>&lt;div class="col-dsk-4"&gt;</code>), the while loop exits, then continues a new <code>&lt;div class="row"&gt;</code> until it loops through all the element in the MySql Table.</p>
  
  <p>Is my solution correct or not? If so, please help me, else, please show me your solution.</p>