closing the MySQL connection at the end of every script with PHP code

RegisterLogin
closing the MySQL connection at the end of every script with PHP code
Post Description: closing the MySQL connection at the end of every script with PHP code
Tags: closing, the, MySQL, connection, at, the, end, of, every, script, with, PHP, code
This Post Was Posted On Feb 29, 2008 By web hosting #1481
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.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Mon Dec 19, 2011 7:52 am
Powered by: Webune Forums V3