• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem drop -down dynamically

#3
(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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.