- Forums
- MySQL
- Closing The MySQL Connection At The End Of Every Script With PHP Code
This Page Contains information about Closing The MySQL Connection At The End Of Every Script With PHP Code By wallpaperama in category MySQL with 0 Replies. [878], Last Updated: Sat May 18, 2024
wallpaperama
Mon May 21, 2007
0 Comments
1526 Visits
hi, my name is hostman, i am with webune.com support, and one of the questions i get ask frequently is why do i get this error on my php scripts: Warning: mysql_connect() [function.mysql-connect]: Too many connections in
well, the reason is because bad programmers don't close their mysql connections. even though php will automatically close each connections, it never fails to be an efficient coder. so how do you fix this.
well, close all mysql connections at the end of your script with the following function code:
mysql_close($mysql_connection);
NOTE: the variable $mysql_connection is whatever variable you use to connect to your mysql server.
hope this help:
Webune Support - World Class IT Support.