CodeIgniter Forums
problem in $this->db->or_where() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: problem in $this->db->or_where() (/showthread.php?tid=41260)

Pages: 1 2


problem in $this->db->or_where() - El Forum - 05-03-2011

[eluser]Sudz[/eluser]
Post the error you are getting.


problem in $this->db->or_where() - El Forum - 05-03-2011

[eluser]Bigil Michael[/eluser]
i didn't get error

it is working

not getting the correct result


problem in $this->db->or_where() - El Forum - 05-03-2011

[eluser]Bigil Michael[/eluser]
Quote:if($search!=‘all’){
$this->db->like('heading', $search);
}
$this->db->where('(cat_id = '.(int)$category.' OR subcat_id = '.(int)$category.')', NULL, FALSE);
$this->db->where('featured', 1);
$this->db->where('status', 1);

i echoed the query and run it on my sql
there also it shows 0 values


problem in $this->db->or_where() - El Forum - 05-03-2011

[eluser]Sudz[/eluser]
Ok,then Post your query,
Is there matching record in your database table


problem in $this->db->or_where() - El Forum - 05-03-2011

[eluser]Bigil Michael[/eluser]
i solved my problem using this code
Quote:if($search!=‘all’){
$this->db->like('heading', $search);
}
$this->db->where('(cat_id = '.(int)$category.' OR subcat_id = '.(int)$category.')', NULL, FALSE);
$this->db->where('featured', 1);
$this->db->where('status', 1);

thanks to everyone