Welcome Guest, Not a member yet? Register   Sign In
HELP joining tables...
#4

[eluser]chazy (aldever calvo)[/eluser]
Code:
function GetAllDetails()
    {
        $this->db->join('user_details', 'user.user_id = user_details.user_det_id');
        $this->db->join('user_type', 'user.user_type_id = user_type.user_type_id', 'left');
        $this->db->where('user_id', $userId);
        $query = $this->db->get('user');
        
    
        return $query->result();
    }

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: userId

Filename: models/user_model.php

Line Number: 45


this is for my controller...
Code:
function index()
{
$data['users'] = $this->user_model->GetAllDetails();
$this->load->view('users/users_index', $data);
}

i can't seem to find a way why i have error Undefined variable: userId
even if i do it this way

$data['users'] = $this->user_model->GetAllDetails($userId);


Messages In This Thread
HELP joining tables... - by El Forum - 01-11-2011, 11:02 AM
HELP joining tables... - by El Forum - 01-11-2011, 11:13 AM
HELP joining tables... - by El Forum - 01-11-2011, 11:46 AM
HELP joining tables... - by El Forum - 01-11-2011, 11:56 AM
HELP joining tables... - by El Forum - 01-11-2011, 12:05 PM
HELP joining tables... - by El Forum - 01-11-2011, 12:14 PM
HELP joining tables... - by El Forum - 01-11-2011, 12:24 PM
HELP joining tables... - by El Forum - 01-11-2011, 12:30 PM
HELP joining tables... - by El Forum - 01-11-2011, 12:55 PM
HELP joining tables... - by El Forum - 01-11-2011, 12:57 PM
HELP joining tables... - by El Forum - 01-11-2011, 01:02 PM
HELP joining tables... - by El Forum - 01-11-2011, 01:04 PM
HELP joining tables... - by El Forum - 02-11-2011, 12:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB