Closing The MySQL Connection At The End Of Every Script With PHP Code



Closing The MySQL Connection At The End Of Every Script With PHP Code
 (380) Click. Work. Collect
Closing The MySQL Connection At The End Of Every Script With PHP Code
Post Description:
Post Tags: closing, the, mysql, connection, at, the, end, of, every, script, with, php, code
This Post Has Been Viewed 445 Times Since Mon May 21, 2007 8:49 pm Posted By hostman with 0 replies
Closing The MySQL Connection At The End Of Every Script With PHP Code
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     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About Closing The MySQL Connection At The End Of Every Script With PHP Code




(0) Comments