Close connection - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Close connection (/showthread.php?tid=71473) Pages:
1
2
|
RE: Close connection - omid_student - 08-19-2018 (08-18-2018, 04:03 AM)InsiteFX Wrote: You would need to keep track of your query caches maybe in an array etc; Can i get query string after run it? Example: $this->db->where('ID','1'); $res = $this->db->get('user'); echo $this->db->get_compiled_select(); //here i need last query string RE: Close connection - InsiteFX - 08-19-2018 Did you try using: PHP Code: $lastQuery = $this->db->last_query() The compiled method only allow getting insert, update and delete methods. RE: Close connection - omid_student - 08-19-2018 (08-19-2018, 03:17 AM)InsiteFX Wrote: Did you try using: Oh yes it is returning last query So i have to save query for when i need remove cache Thanks RE: Close connection - whutboy - 08-21-2018 (08-17-2018, 04:21 AM)kaitenz Wrote:AFAIK, Query builder automatically close the database after use(08-17-2018, 04:07 AM)omid_student Wrote: Hi == Agree with you,but I can not find the code , can you tell me when and where did query builder automatically close the database connection? RE: Close connection - omid_student - 08-21-2018 (08-18-2018, 04:03 AM)InsiteFX Wrote: You would need to keep track of your query caches maybe in an array etc; Yes Thank you |