title: Why my php code is not fetching multiple rows from database
body: <p>Here's my php code unable to fetch multiple rows at a time...
  as I have seen on internet the functions are right according to the version of php.</p>
  <pre><code>&lt;?php 
                          require'db_conn.php';
                          $q1 = &quot;select * from contact&quot;;
                          $res = mysqli_query($conn,$q1);
                      echo &quot;
                      &lt;table class='table'&gt;
                          &lt;thead class='thead-dark'&gt;
                              &lt;tr&gt;
                                  &lt;th scope='col'&gt;#&lt;/th&gt;
                                  &lt;th scope='col'&gt;id&lt;/th&gt;
                                  &lt;th scope='col'&gt;Address&lt;/th&gt;
                                  &lt;th scope='col'&gt;City&lt;/th&gt;
                                  &lt;th scope='col'&gt;Country&lt;/th&gt;
                                  &lt;th scope='col'&gt;State&lt;/th&gt;
                                  &lt;th scope='col'&gt;Zip&lt;/th&gt;
                                  &lt;th scope='col'&gt;Phone&lt;/th&gt;
                                  &lt;th scope='col'&gt;#&lt;/th&gt;
                              &lt;/tr&gt;
                          &lt;/thead&gt;&quot;;
  
                          while ($row = mysqli_fetch_assoc($res)) 
                          {
                              $id = $row[&quot;id&quot;];
                              $address = $row[&quot;address&quot;];
                              $city = $row[&quot;city&quot;];
                              $country = $row[&quot;country&quot;];
                              $state = $row[&quot;state&quot;];
                              $zip = $row[&quot;zip&quot;];
                              $phone = $row[&quot;phone&quot;];
                          }
  
                          echo &quot;
                          &lt;tbody&gt;
                              &lt;tr&gt;
                                  &lt;td&gt; &lt;input type='checkbox' name=''&gt; &lt;/td&gt;
                                  &lt;td&gt;$id&lt;/td&gt;
                                  &lt;td&gt;$address&lt;/td&gt;
                                  &lt;td&gt;$city&lt;/td&gt;
                                  &lt;td&gt;$country&lt;/td&gt;
                                  &lt;td&gt;$state&lt;/td&gt;
                                  &lt;td&gt;$zip&lt;/td&gt;
                                  &lt;td&gt;$phone&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt;&quot;;
  ?&gt;
  </code></pre>
  <p>Here's the image contains multiple rows however this code is just fetching single row</p>
  <p><a href="https://i.stack.imgur.com/ee70j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ee70j.png" alt="enter image description here" /></a></p>