tkm Posted May 7, 2008 Share Posted May 7, 2008 Hello Mates, This is basic query. I have read from php.net manual that mysql automatically destroys a connection with php after the script executes. Also a forum member suggested that it is safer to have many opened connection rather than having unnecessary close resource connection code. Can anyone be kind enough to share his/her views on this? I have this php script from where I do open a lot of connections to mysql and only close it while the application logout (I understand mysql just opens one connection for one source in normal scenerio). Is this the worst possible approach? Can I just trust on my hosting ISP's mysql configuration setting that the connections will be closed automatically, provided they have that setting? Any suggestions would be a great help. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/104531-php-mysql-connection-closes-on-its-own/ Share on other sites More sharing options...
budimir Posted May 7, 2008 Share Posted May 7, 2008 Well, try Google for "MySQL number of connections" and you will see what happens when you get "Too much connections" error. There is a reason why the connection should be closed! Quote Link to comment https://forums.phpfreaks.com/topic/104531-php-mysql-connection-closes-on-its-own/#findComment-535079 Share on other sites More sharing options...
tkm Posted May 7, 2008 Author Share Posted May 7, 2008 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/104531-php-mysql-connection-closes-on-its-own/#findComment-535084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.