CodeIgniter Forums
[Solved] How to "clear" Active Record limits? - 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: [Solved] How to "clear" Active Record limits? (/showthread.php?tid=12418)



[Solved] How to "clear" Active Record limits? - El Forum - 10-18-2008

[eluser]mtbkrdave[/eluser]
Hi Y'all-

This would seem like a pretty silly question, but I can't seem to find a resolution in the manual or forums...

If I want to do multiple database queries in a single function, how do I "clear" the conditions in-between queries?

Code:
$this->db->where('var_1','data_1');
$query1 = $this->db->get('table1');

$this->db->where('var_2','data_2');
$query2 = $this->db->get('table2');

In the example above, how would I prevent the 'var_1' condition from applying to the second query being AND'ed with the second where() statement??

Thanks,
[medic]dave


[Solved] How to "clear" Active Record limits? - El Forum - 10-18-2008

[eluser]manilodisan[/eluser]
Does the first condition affect the 2nd when running the code? I doubt that...


[Solved] How to "clear" Active Record limits? - El Forum - 10-18-2008

[eluser]mtbkrdave[/eluser]
As is often the case, a little trial-n-error confirms your suspicion!

It seems that the query conditions are reset after the query is run.

Thanks!
[medic]dave