terryds Posted June 13, 2013 Share Posted June 13, 2013 I found that the mysql connection will be automatically closed when the php script finish executing the code....Is that right ? How to check if the connection is closed or not? Will it close the connection automatically too if i use PHP Data Objects (PDO) too ? Link to comment Share on other sites More sharing options...
birbal Posted June 13, 2013 Share Posted June 13, 2013 (edited) All php resources will be destroyed at the end of the script including PDO. It wont matter for small script. But if after opening a connection there is lot of time consuming task your script is doing, connection will be still opened. with that kind of simultanouse call to script can exceed your maximum mysql connection. You can check the variable to see what does it holds to ensure you have active connection or not. Edited June 13, 2013 by birbal 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now