Welcome Guest, Not a member yet? Register   Sign In
Close connection
#14

(08-17-2018, 04:21 AM)kaitenz Wrote:
(08-17-2018, 04:07 AM)omid_student Wrote: Hi
Is it important for close connection after query?
Example
$res = $this->db->query('')->result_array();
$this->db->close();

Also i have other question
How do i can delete cache only for special query?
at the moment we can delete all cache

AFAIK, Query builder automatically close the database after use (correct me if I'm wrong)

For special queries, assign your special query to a variable:
PHP Code:
$special_query $this->db->query(); 

Then if you want to use 
PHP Code:
$this->db->flush_cache(); 

You can still use your special query:
PHP Code:
$special_query->result(); 

But I didn't try this before (but I use query caching a lot), so try it for yourself.
AFAIK, Query builder automatically close the database after use 
== 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?
Reply


Messages In This Thread
Close connection - by omid_student - 08-17-2018, 04:07 AM
RE: Close connection - by kaitenz - 08-17-2018, 04:21 AM
RE: Close connection - by whutboy - 08-21-2018, 07:32 PM
RE: Close connection - by InsiteFX - 08-17-2018, 10:24 AM
RE: Close connection - by omid_student - 08-17-2018, 10:40 AM
RE: Close connection - by InsiteFX - 08-18-2018, 04:03 AM
RE: Close connection - by omid_student - 08-19-2018, 12:50 AM
RE: Close connection - by omid_student - 08-21-2018, 10:35 PM
RE: Close connection - by InsiteFX - 08-19-2018, 03:17 AM
RE: Close connection - by omid_student - 08-19-2018, 04:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB