$this->db->get_where OR Same thing.

#1
[eluser]pisio[/eluser]
Hi all Smile
How i can run SQL :
Quote:SELECT * FROM `users` WHERE `name` = $name OR `mail` $mail

Code:
$smasiv =  array('name' => $p['name'],'mail' => $p['mail']);
$query = $this->db->get_where('user',$smasiv );

#2
[eluser]pistolPete[/eluser]
Please use [ code ] tags!

Read the user guide: http://ellislab.com/codeigniter/user-gui...tml#select

Code:
$this->db->where('name', $p['name']);
$this->db->or_where('mail', $p['mail']);
$query = $this->db->get('user');

#3
[eluser]BrianDHall[/eluser]
Code:
$query = $this->db->where('user', $smasiv)->or_where('mail', $mail)->get('user');

Edit: PistolPete beat me to it Wink

#4
[eluser]praveens[/eluser]
try this

Code:
$this->db->where('name =', $name);
$this->db->or_where('mail =', $mail);
$query = $this->db->get('users');

#5
[eluser]pisio[/eluser]
10x to all Smile



These Framework is very cool and have best support Smile

#6
[eluser]marjune[/eluser]
Code:
$this->db->query("SELECT * FROM `users`  WHERE `name` =  $name OR `mail`= $mail");


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.