• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to pass id...pls edit my code.......

#1
[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();        
    }

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

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

#4
[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.

#5
[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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.