CodeIgniter Forums

Full Version: how to pass id...pls edit my code.......
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]atulswe1[/eluser]
1.controller

Code:
function abc($id)
     {
      $this->load->model('emp_model');
      $data['rows']=$this->emp_model->info1($id);
   $this->load->view('employee_personal_view',$data);
     }

2.model

Code:
function info1($id)
    {
    $this->load->database();  
    $query = $this->db->get_where('employee',array('id'=>$id));
    return $query->row_array();        
    }

El Forum

[eluser]InsiteFX[/eluser]
CodeIgniter Users Guide - URI Routing

El Forum

[eluser]atulswe1[/eluser]
what is this..can't understand

El Forum

[eluser]InsiteFX[/eluser]
You need to be more specific about what and how you want pass the id.

The above is routing which is one way of passing vatiables.

El Forum

[eluser]cartalot[/eluser]
if you are using default index.php
if your site name is 'mysite.com', your controller is 'View'
your method is 'abc', and the id number is '999'
mysite.com/index.php/view/abc/999