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