• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
data displaying problem.

#1
[eluser]Unknown[/eluser]
Model code
Code:
$username = $this->uri->segment(3);
$user_data = $this->db->query("SELECT * FROM user_profiles WHERE username = '$username' ");
  return $user_data->result();
Controller Code
Code:
$this->load->model('users_model');
$data['value'] = $this->users_model->user_data();
$this->load->view('header');
$this->load->view('profile',$data);

View Code
Code:
echo $value[0]->username;
echo $value[0]->place;

how can i directly get data using only $value without [0] after it ?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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