add a function in where using AR |
[eluser]mmiranda[/eluser]
Hi, i want to run this query: select id from user where username = '$user' and password = sha('$password') i tried : $query = $this->db->select('id') ->get_where('user', array('username' => $username, 'password' => SHA('$password') ,1); but it not working... what i am doin wrong?
[eluser]Thorpe Obazee[/eluser]
[quote author="mmiranda" date="1245893459"]Hi, i want to run this query: select id from user where username = '$user' and password = sha('$password') i tried : Code: $query = $this->db->select('id') but it not working... what i am doin wrong?[/quote] Code: $query = $this->db->select('id') did you mean sha1()? did you check what sql statement it produced?
[eluser]mmiranda[/eluser]
well, sha is synonymous with SHA1(). i didnt check the sql, i dont know how to do it...
[eluser]Thorpe Obazee[/eluser]
[quote author="mmiranda" date="1245909924"]well, sha is synonymous with SHA1(). i didnt check the sql, i dont know how to do it...[/quote] I didn't know what and it gives me errors: Quote:Fatal error: Call to undefined function: sha() Anyway, use the profiler class and you'll see the generated sql statements. |
Welcome Guest, Not a member yet? Register Sign In |