Using one where condition in two queries - 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: Using one where condition in two queries (/showthread.php?tid=14402) |
Using one where condition in two queries - El Forum - 01-01-2009 [eluser]Computerzworld[/eluser] Hello, I am having one query & one pagination query & I want to use only one where condition between two.Here is my code. Code: $this->db->where('isDeleted',0); But this where conditon applies to only $this->db->count_all_results() condition & not $this->db->get(). Is it possible to use that in common between these two? If yes then how? Please help me. Thanks in advance. Using one where condition in two queries - El Forum - 01-01-2009 [eluser]Computerzworld[/eluser] got the solution .... what I did is created one function in model itself & put all the where conditions in it & called that function before getting paging result & query result.... And that worked... HTH..... Using one where condition in two queries - El Forum - 01-01-2009 [eluser]xwero[/eluser] the CI solution for your problem are the AR cache functions. Using one where condition in two queries - El Forum - 01-01-2009 [eluser]Computerzworld[/eluser] thanks for the reply..... i will try it in my queries.... |