NoDoze Posted January 22, 2009 Share Posted January 22, 2009 If you have multiple query statements spread out in one HUGE php file, Should there be an open/close connection after EACH query? Is is it better to have a open/config cnnection file at the beginning, then a close connection file at the end? Are there benifits/drawbacks for each way? Link to comment https://forums.phpfreaks.com/topic/142020-simple-question-openclose/ Share on other sites More sharing options...
trq Posted January 22, 2009 Share Posted January 22, 2009 Because of php's garbage collection there is no need to close a mysql connection at all. Just open it once when you first need it and thats it. Link to comment https://forums.phpfreaks.com/topic/142020-simple-question-openclose/#findComment-743669 Share on other sites More sharing options...
fenway Posted January 27, 2009 Share Posted January 27, 2009 And before/after each query would be waste of time. Link to comment https://forums.phpfreaks.com/topic/142020-simple-question-openclose/#findComment-747514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.