0

Its my controller code

<?php




class Booking_Controller extends CI_Controller{



        public function __construct(){


            parent::__construct();
            $this->load->model('Books_model');

        }



  This is my model code

<?php


class Books_model extends CI_Model{



    public function __construct(){

        $this->load->database();


    }

    public function get_restaurants()
    {
        $sql = "SELECT id, names FROM restaurants ";
        $query = $this->db->query( $sql );
        return $query->result();

    }

}




    public function view()
    {

        $data['result']=$this->Books_model->get_restaurants();

        $this->load->helper(array('form','url'));
        $this->load->view('restaurants/booking',$data);


    }


}

Plz tell me what code i written in view file that i get data in dropdown form...thanx

Edited by pritaeas: Moved to PHP.

2
Contributors
1
Reply
15
Views
2 Years
Discussion Span
Last Post by cereal
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.