$this->db->get_where OR Same thing. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: $this->db->get_where OR Same thing. (/showthread.php?tid=24225) |
$this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]pisio[/eluser] Hi all How i can run SQL : Quote:SELECT * FROM `users` WHERE `name` = $name OR `mail` $mail Code: $smasiv = array('name' => $p['name'],'mail' => $p['mail']); $this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]pistolPete[/eluser] Please use [ code ] tags! Read the user guide: http://ellislab.com/codeigniter/user-guide/database/active_record.html#select Code: $this->db->where('name', $p['name']); $this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]BrianDHall[/eluser] Code: $query = $this->db->where('user', $smasiv)->or_where('mail', $mail)->get('user'); Edit: PistolPete beat me to it $this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]praveens[/eluser] try this Code: $this->db->where('name =', $name); $this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]pisio[/eluser] 10x to all These Framework is very cool and have best support $this->db->get_where OR Same thing. - El Forum - 11-03-2009 [eluser]marjune[/eluser] Code: $this->db->query("SELECT * FROM `users` WHERE `name` = $name OR `mail`= $mail"); |