title: selected value get from db into Data list option using php mysql
body: <p>I need to get selected value from db into datalist box.Tell me how to do it. Here is the code. </p>
  
  <pre><code>&lt;input list="Rank_Name" class="form-control" required&gt;
                              &lt;datalist id="Rank_Name"&gt;
                           &lt;?php
                              $sel_cus = "select Rank_Name from ranks where Rank_Status=1";
                              $res_cus = mysqli_query($connection, $sel_cus);
                              while ($row = mysqli_fetch_array($res_cus)) {
                              ?&gt;
                              &lt;option value="&lt;?php echo $row['Rank_Name'];?&gt;"&gt;&lt;/option&gt;
                             &lt;?php
                              } 
                              ?&gt;
                              &lt;/datalist&gt;                   
  </code></pre>