Welcome Guest, Not a member yet? Register   Sign In
Problem with Selecting Data form Database
#1

[eluser]haris244808[/eluser]
Hi there,
I created a users_model.php where i select all users :
Code:
function select_all_users(){

  $query = $this->db->get('users');

  if ($query->num_rows() > 0 ) {
   return $query->result();
  }
  
}

then i have users.php controller where i am trying to get all the data from users table:
Code:
function select_all(){

  $this->load->model('users_model');

  $data['query'] = $this->users_model->select_all_users();

  print_r($query);
  die();

  $this->load->view('newFile_view', $data);
}

but i get an error as query is undefined variable::
i tried $query->id , $query['id'] but still same problem... I am trying to stopre datas to an array, then get the specific ones...

Can someone help me with this?

Thnx


Messages In This Thread
Problem with Selecting Data form Database - by El Forum - 03-09-2013, 04:32 PM
Problem with Selecting Data form Database - by El Forum - 03-09-2013, 05:43 PM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 03:52 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 04:37 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 04:41 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 04:47 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 04:55 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 04:58 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:09 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:13 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:30 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:38 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:47 AM
Problem with Selecting Data form Database - by El Forum - 03-10-2013, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB