Welcome Guest, Not a member yet? Register   Sign In
problem drop -down dynamically
#3

(This post was last modified: 05-30-2015, 08:26 AM by wolfgang1983.)

(05-30-2015, 05:07 AM)Athov Wrote: Well the easiest without model is




PHP Code:
<?php

//in some controller

function method_name(){
 
 $data['rows'] = $this->db->select('id, name')->get('users');
 
 $this->load->view('some_view'$data);

PHP Code:
<!-- some view -->

<?
php foreach($rows->result_array() as $row): ?>
  <?php echo $row['id']; ?>
  <?php echo $row['name']; ?>
<?php 
endforeach; ?>
<!-- just add the HTML and you are ready--> 

Just notice in the image you are loading the database in there not sure why. I would recommend using the config/database.php and autoload the library
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
problem drop -down dynamically - by Delta-51 - 05-29-2015, 11:24 AM
RE: problem drop -down dynamically - by Athov - 05-30-2015, 05:07 AM
RE: problem drop -down dynamically - by wolfgang1983 - 05-30-2015, 06:03 AM
RE: problem drop -down dynamically - by Delta-51 - 05-31-2015, 11:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB