title: select query in view file in codeigniter
body: <p>This is my simple php html code.</p>
  
  <pre><code>&lt;select id="district" name="district"&gt;
      &lt;option value=""&gt;Select district&lt;/option&gt;
  &lt;?php 
    $sql="SELECT * FROM district";
  
      $result = mysqli_query($sql);
  
      while($row = mysqli_fetch_array($result))
  {
  $district_id   = $row['district_id'] ;
  $district_name = $row['district_name'];
  ?&gt;
   &lt;option value="&lt;?php echo $district_id;?&gt;"&gt;&lt;?php echo $district_name;?&gt;&lt;/option&gt;
  &lt;?php
  
  }
  ?&gt;      
  &lt;/select&gt;
  </code></pre>
  
  <p>But it's not working. database is autoloaded.What will be the problem.</p>