• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Show user with id

#1
Hello
I have another problem i want to show a user page like : monsite.com/user/1 but i can't i search for several hours on forum etc ...

My code : 


It my user controller
PHP Code:
   public function index($id FALSE){
        
 
       $data['user'] = $this->user_model->get_account($id);
        
$this->load->view('layout/header');
 
       $this->load->view('user/user' $data);
 
       $this->load->view('layout/footer');
 
   


And my model :

PHP Code:
    public function get_account($id)
    {
     
 $query $this->db->where('guid',$id)->get('accounts');
     
 return $query->row();
    } 


And i add this in my route :

PHP Code:
$route['user/(:num)'] = "user/user/$1"


and all time when i go to monsite.com/user/1 he say 404 not found 

i have create a views in user/user .

Thanks for help  Shy
Reply

#2
Please see the CodeIgniter User Guide

SEE:

Remapping Method Calls
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
solved thanks you can closed the thread
Reply

#4
Just edit your topic and add [SOLVED} in the title.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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