Welcome Guest, Not a member yet? Register   Sign In
Loading not working for models?

I have just installed CI and for some reason, my models are not properly loading the libraries. Here is my code for my model:
class Usermodel extends Model {
    function Usermodel() {
    function login() {
        if ($this->input->post('username') && $this->input->post('password')) {
            if ($this->checkpassword($this->input->post('username'),$this->input->post('password'))) {
    function logoff() {
    function checkpassword($username,$password) {
        $query = $this->db->query("SELECT * FROM users WHERE username='".$username."'");
        $obj = $query->result();
        $obj = $obj[0];
        if (md5($password)==$obj->password) {
            return TRUE;
        } else {
            return FALSE;

I need session and database, and I have tried the autoload, I have tried loading in the individual functions, and in the constructor and nothing seems to work. Is there something I am missing?

[eluser]Thorpe Obazee[/eluser]
It should be accessible from there when you autoload it. Maybe you can paste how you autoloaded it?

Nevermind, I got it working again.

Theme © iAndrew 2016 - Forum software by © MyBB