Welcome Guest, Not a member yet? Register   Sign In
this simple imodel is returning false in my controller instead of true for password denis and username denis
#1

[eluser]Unknown[/eluser]
This model is returning false from database and when i change the code so as to insert it is inserting data to database.Please help guys .I have no idea what the problem is

class Membership_model extends CI_Model{

function __construct(){

parent::__construct();
}
function validate(){

$this->db->where('user_name',$this->input->post('user_name'));
$this->db->where('password',md5($this->input->post('password')));
$query=$this->db->get('membership');

if($query->num_rows()==1){
return TRUE;
}
#2

[eluser]InsiteFX[/eluser]
I would check to see what is being returned by your query, use var_dump or print_r to see what is returned.

From what you have shown theres not much to go on to help. Plus you should not use MD5 it has already been cracked.




Theme © iAndrew 2016 - Forum software by © MyBB