Welcome Guest, Not a member yet? Register   Sign In
multiple where stmts how to use in pagination
#1

[eluser]sunshine[/eluser]
Is there any way by which we can have multiple where clauses use OR instead of AND?
#2

[eluser]mdavis1982[/eluser]
Hi...

Yeah... you can have multiple WHERE clauses... just do:

Code:
$this->db->where('name', $name);
$this->db->where('title', $title);
$this->db->where('status', $status);

If you need OR instead of and, use or_where():

Code:
$this->db->where('name', $name);
$this->db->or_where('id, $id);

Hope this helps...

Matt
#3

[eluser]sunshine[/eluser]
Hey thanx Matt, it worked!!!
#4

[eluser]mdavis1982[/eluser]
No problem.

It's all in the user guide! ;-)

Cheers...

Matt




Theme © iAndrew 2016 - Forum software by © MyBB