This is my Model, I am querying the database, retreving what i need form it, then comparing. Except the query is treating the salt not as a column name, but as a string, which is fine, except it's treating the word salt as the string, not the data from the database. How can i get around this?
function login($username, $password) {
$this->db->query("SELECT firstname, username, password, salt FROM table_name WHERE username='$username' AND password = 'sha1(salt.$password'");
$this->db->limit(1);`
$query = $this->db->get();
if($query->num_rows() == 1) {
return $query->result(); //Data is true
} else {
return false; //Data is false
}
}