CodeIgniter Forums
user login not work - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: user login not work (/thread-41983.html)

user login not work - El Forum - 05-23-2011

I create user login,it work for when one user in the data base(one row),but when I add new users it is not working,what is the reson please help me.

Contrall class>>>>>>>>>>>
function validate_credentials(){

$query= $this->membership_model->validate();

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





MOdel class>>>>>>>>>>>>

function validate(){



if ( $query->num_rows == 1){

return true;



echo 'khhhhhhhjkj';

this code work properly one user in the data base......

Thank you,

Hasitha Bandara Athauda............

user login not work - El Forum - 05-23-2011

Your code seems ok. Are you using global xss. Could it be that the password cause the error? Maybe try with

This is not very secure since it leaves the field unprotected.
You should btw use something like
or any other encryption, so as not to store the real password in the db and also sanitize through enryption the data.

PS. please use the code tag to place code. [ code] [ /code] without the trailing space after [

user login not work - El Forum - 05-23-2011

If your database passwords are hashed then you need to also hash the user's entered password to compare it to the database password!