[eluser]LuckyFella73[/eluser]
hello all,
I have a problem working with an instance of the CI database class.
I followed a tutorial of "Bramme" -> a basic login class (named "Auth").
In the class (Auth.php) an instance of the database class is loaded:
Code:
# first lines cut
function Auth($props = array())
{
$this->CI =& get_instance();
# Load additional libraries, helpers, etc.
$this->CI->load->library('session');
$this->CI->load->database();
# rest fo code here
Within one function, I'm able to access my database, for example:
Code:
$this->CI->db->where('vorname', $this->vorname);
$this->CI->db->where('nachname', $this->nachname);
$this->CI->db->where('mitgliedsnummer', $this->mitgliedsnummer);
$this->CI->db->where('geburtsdatum', $this->geburtsdatum);
$query = $this->CI->db->get($this->usertable);
I added a method to the class (a set new password function) and can't access
the db anymore using the same synthax. In the new method I tried:
Code:
$this->CI->db->where('mitgliedsnummer', $this->session->userdata('mitgliedsnummer'));
I just get an error message at this line:
Quote:Fatal error: Call to a member function on a non-object in ...
Any ideas what I'm doing wrong?