controller - Select_Ctrl
``
class Select_Ctrl extends CI_Controller {
public function index()
{
$this->load->model('Select_Model');
$data['val'] = $this->Select_Model->get_data();
$this->load->view('form',$data);
}}?>
``
Model - Select_Model
``
<?php class Select_Model extends CI_Model{
public function get_data(){
if($this->input->post('submit')){
$this->db->where('country',$this->input->post('country'));
$this->db->where('state',$this->input->post('state'));
$this->db->where('city',$this->input->post('city'));
$query = $this->db->get('tablename');
return $query->result_array();
}}}?>
``
View file normal form creation.