title: How to use select * from in codeigniter 3?
body: <p>I'm new to codeigniter, even I'm a newbie. What if a line of native code like this is implemented in codeigneter, how to display it? I'm not familiar with model or view controllers. usually i work only with native</p>
  <pre><code>&lt;div class=&quot;input-group mb-3&quot;&gt;
      &lt;select class=&quot;custom-select&quot; onchange='changeValue(this.value)' required&gt;
          &lt;option&gt;Select Account&lt;/option&gt;
          &lt;?php 
          $result = mysqli_query($con, &quot;select * from nflx_acc&quot;);  
          $jsArray = &quot;var accData = new Array();\n&quot;;
          while ($row = mysqli_fetch_array($result)) {  
          echo '&lt;option value=&quot;' . $row['nflxorder'] . '&quot;&gt;No.' . $row['id'] . '&lt;/option&gt;';  
          $jsArray .= &quot;accData['&quot; . $row['nflxorder'] . &quot;'] = {order_mail:'&quot; . addslashes($row['nflxorder']) . &quot;',order_code:'&quot;.addslashes($row['nflxcode']).&quot;',category:'&quot;.addslashes($row['type']).&quot;'};\n&quot;;
  
          }
          ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;input id=&quot;order_mail&quot;&gt;
  &lt;input id=&quot;order_code&quot;&gt;
  &lt;input id=&quot;category&quot;&gt;
  
  &lt;script&gt; 
      &lt;?php echo $jsArray; ?&gt;
      function changeValue(id){
          document.getElementById('order_mail').value = accData[id].order_mail;
          document.getElementById('order_code').value = accData[id].order_code;
          document.getElementById('category').innerHTML = accData[id].category;
      };
  &lt;/script&gt;
  </code></pre>
  <p>Its function displays data from database &quot;nflx_acc&quot; in the form of select options,
  when select is selected display data to text field from row ['nflxorder'],['nflxcode'],['type']</p>