Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <------------------model----------------->
- Class Train_model extends CI_Model{
- function __construct()
- {
- parent::__construct();
- $this->load->database();
- }
- function Get_stream (){
- $q= $this->db->get('stream');
- if($q->num_rows() > 0 ){
- foreach ($q->result() as $row)
- {
- $data[]=$row;
- }
- return $data;
- }
- }
- }
- <------------------>
- <----------------------- Controler--------------->
- class combo extends CI_Controller{
- public function __construct() {
- parent::__construct();
- $this->load->model('Train_model');
- }
- public function index(){
- $data['stream']= $this->Train_model->Get_stream();
- $this->load->view('form_input',$data);
- }
- }
- <------------------->
- <---------view-------------->
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title></title>
- </head>
- <body>
- <?php echo form_open('stream/input'); ?>
- <?php foreach($stream as $r) {
- echo "Stream" .' : '.form_dropdown('tes',$r);
- }
- ?><br>
- </body>
- </html>
- <--------------->
Advertisement
Add Comment
Please, Sign In to add comment