[eluser]symbol.software[/eluser]
Hello CI community,
I just moved to CI and now I'm working to my own user_model class.
I'm trying to query the users table but here is what happens:
When the column name is 'username' the this field is erased from my query!
When I rename the column name to 'userid' or 'uname' or anything else it works fine.
Is this a security protection, how do I avoid this ?
Here is my code:
Code:
$query = $this->db->get_where($this->user_table, array('username'=>$username, 'password'=>$password));
The result of this query is:
Code:
SELECT * FROM (`users`) WHERE ` = 'jhon365' AND `password` = 'mypassword'
Here is the code that works
Code:
$query = $this->db->get_where($this->user_table, array('uname'=>$username, 'password'=>$password));
The result of this query is:
Code:
SELECT * FROM (`users`) WHERE `uname` = 'jhon365' AND `password` = 'mypassword'
It is obvious that active record class is simply erasing the word 'username' from my code.
How do I solve this ? I really like to have my field named 'username'.
Thank you so much!
Michael