I'm having trouble understanding how to get data (single row) from a model query into a controller function in codeigniter. I've searched the stack overflow posts, but no luck. I have a query in a model like this:
function login($email, $sha1Pass) {
$loginArray = array('email' => $email, 'pw' => $sha1Pass);
$this->db->select('lid, email, pw');
$this->db->from('login');
$this->db->where($loginArray);
$query = $this->db->get();
return $query->row();
}
There will only be 1 returned row [lid, email, pw]
I then have a controller that calls this model query.
$report['row'] = $this->LoginCheck->login($email, $encp);
What I need is 2 fields from the database from the row and assign them to a variable like this:
$lid = $report['lid'];
$email = $report['email'];
lid and email are the fields from the database.