[eluser]Konvurt[/eluser]
Hi,
I have variables that are set in a controller that I need to access for a query found in my model.
Controller:
Code:
$data['main_content'] = 'login_form';
$this->load->view('includes/template', $data);
$this->load->model('membership_model');
//session_start();
require_once 'cas.php';
$MYUIN=getCAS();
//$MYUIN = $_SESSION['MYUIN'];
$MYNETID = $_SESSION['MYNETID'];
$netid = $MYNETID;
//die("Your NETID is $netid");
$query = $this->membership_model->validate();
}
Model
Code:
<?php
class Membership_model extends Model {
function validate()
{
$this->db->where('netid',$this->netid); //this->input->post('netid')
//$this->db->where('password', md5($this->input->post('password')));
$query = $this->db->get('users');
echo $this->db->last_query(); exit();
if($query->num_rows == 1)
{
//die("Your netid was found.");
return true;
}
}
Whenever I try this I receive an error a message stating:
Quote:Undefined property: Membership_model::$netid
The query from the model outputs as : SELECT * FROM (`users`) WHERE `netid` IS NULL
If I update my model to read " $this->db->where('netid',$netid);
The query from the model outputs as : SELECT * FROM (`users`) WHERE `netid`= 0
I am sure this probably something simple. I have poked around on this and have gotten anything but more frustrated.
Thanks.