Welcome Guest, Not a member yet? Register   Sign In
model not checking database
#1

[eluser]Unknown[/eluser]
could anyone help i have my login page dashboard etc when trying to login it doesnt insert to database or seem to be validating the information

thanks in advance


<?php



class Account_model extends CI_Model



{

function __construct()

{

parent::__construct();

$this->load->database();

}



function create ($data)

{

if ($this->db->insert('users', $data))

{

return TRUE;

}

return FALSE;

}

//check login

function login()

{

$data = array (

'username'=> $this->input->post('username'),

'logged_in'=> TRUE);

$this->session->set_userdata($data);

}

//logged in

function logged_in()

{

if ($this->session->userdata('logged_in')==TRUE)

{

return TRUE;

}

return FALSE;

}

}

?>





Theme © iAndrew 2016 - Forum software by © MyBB