where() showing "IS NULL" instead of variable value |
Hello guys,
$email=''abc@abc.com'; $pass= 123; $this->db->select('*')->from('user')->where(' email',$email)->where('password',$pass)-> get()->result(); this gives result :- 'select * from uses where email IS NULL and password IS NULL'; But it works with $this->db->query(); plz help me to find why its not taking like :- 'select * from user where email="abc@abc.com" and password="123" '; Thanks,
$emial=''abc@abc.com';
$pass= 123; $this->db->select('*')->from('user')->where(' email',$email)->where('password',$pass)-> get()->result(); You are using different variable name insist of where condition. Correct code: $email=''abc@abc.com'; $pass= 123; $this->db->select('*')->from('user')->where(' email',$email)->where('password',$pass)-> get()->result(); (01-01-2018, 11:39 PM)XtreemDeveloper Wrote: $emial=''abc@abc.com'; sorry that was typing mistake. This is not the error i am facing. if i use "$this->db->select('*')->from('user')->where(' email',$email)->where('password',$pass)-> get()->result();" still it shows "select * from users where email IS NULL and password IS NULL".
Did you use this to see what is going on?
PHP Code: $temp = $this->db->last_query(); Also is there suppose to be a space after the opening quote before email? PHP Code: // | space? What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(01-02-2018, 03:52 AM)InsiteFX Wrote: Did you use this to see what is going on? returns 'select * from user where email IS NULL and password IS NULL'; (01-01-2018, 11:34 PM)ktmonty Wrote: $email=''abc@abc.com'; That's 2 single quotes followed by an email address and another single quote. This would be a syntax error ... I assume that's just a typing error on your part while posting here, but we can't help you debug if you don't give us the actual code as that means important details remain hidden. Please just copy-paste it. Also, moving the thread to General Help as it has nothing to do with installation. |
Welcome Guest, Not a member yet? Register Sign In |