anon_login_001 Posted June 6, 2008 Share Posted June 6, 2008 I've been using PHP way too long not to know the answer to this -- I have a Function in an included 'lib' file, that makes it's own database connection (MySQL), gets a response, and returns information based on that response. At what point is that database connection and result set Garbage? If not specifically destroyed before the function returns, I mean. Would it be thrown out when the function returns, or at script end (which in this case would be the end of the script that included the library script) ... ? Thanks for any leads/answers/links! Link to comment https://forums.phpfreaks.com/topic/109043-solved-db-conn-released-when-function-returns/ Share on other sites More sharing options...
amites Posted June 6, 2008 Share Posted June 6, 2008 once the function is finished anything inside it is gone unless returned, or inside a class Link to comment https://forums.phpfreaks.com/topic/109043-solved-db-conn-released-when-function-returns/#findComment-559406 Share on other sites More sharing options...
anon_login_001 Posted June 6, 2008 Author Share Posted June 6, 2008 Thought so, hoped so. Thanks!! Link to comment https://forums.phpfreaks.com/topic/109043-solved-db-conn-released-when-function-returns/#findComment-559415 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.