![]() |
Active Record Clear Parameters - 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: Active Record Clear Parameters (/showthread.php?tid=50338) |
Active Record Clear Parameters - El Forum - 03-22-2012 [eluser]USCTrojans[/eluser] Hello, I have a logged in model that is called in my parent function to check for users being logged in. When I call another function in that controller, and call a model it "inherits the search parameters from the parent which is searching a different table. Does anyone know how to clear the query? I'm getting an error that looks like this Code: A Database Error Occurred But in the model that is called , only the "morehouse_j09_gmail_com" table should be searched. How do I clear the results from that parent function which searches my "sessions" table in sql? Thanks Active Record Clear Parameters - El Forum - 03-23-2012 [eluser]aquary[/eluser] I think you put something wrong in you script.....Post your code, then we could help. Active Record Clear Parameters - El Forum - 03-23-2012 [eluser]USCTrojans[/eluser] I think it had to do with not "getting" the result. I queried some data and just tested to see if it came back true. I think that somehow cached the query and until I realized I needed to get() the data, it didn't work. Here's my code: Code: $query = $this->db->from('sessions')->where('session_id', $browser_session['session_id']); so without the second line it broke my other function. I had just been using an if(!query) to test if the session was legitimate. Thanks Active Record Clear Parameters - El Forum - 03-23-2012 [eluser]aquary[/eluser] Maybe you have use $this->db->from('sessions') somewhere else, before the line itself, without using it. Better checking where did they come from since you might encounter some error like this again. Btw, I always use $this->db->get('table_name') which help avoiding these kind of errors. |