I took over the management of php site running mysql. The site is currently getting "reached maximum connections errors" The original programmer said that he didn't close out any of his sql calls. So I tried the below code in a footer. Is this correct.
<?php mysql_close();?>
closing database connection calls to mysql
Moderator: General Moderators
-
CincoPistolero
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 23, 2005 4:30 pm
In the future please do not post your question in multiple forums. I've deleted your post in Databases.
And yes, that will close a mysql connection. See below for more info.
http://php.net/mysql_close
And yes, that will close a mysql connection. See below for more info.
http://php.net/mysql_close
-
CincoPistolero
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 23, 2005 4:30 pm
I manange a site that has been working fine since I took over a few weeks ago. I've only made text changes, and at 10am this morning the site gets the following error:
WARNING: mysql_connect(); User ***** has already more than m'max_user_connections' active connections in ../../../database.php line 6
Unable to connect.
The guy who originally created the site never coded <?php mysql_close(); ?> but it is my understanding that closing isn't necessarily needed. I added the closing statement to the footer file and uploaded it, but I still get the above error. Any suggestions?
WARNING: mysql_connect(); User ***** has already more than m'max_user_connections' active connections in ../../../database.php line 6
Unable to connect.
The guy who originally created the site never coded <?php mysql_close(); ?> but it is my understanding that closing isn't necessarily needed. I added the closing statement to the footer file and uploaded it, but I still get the above error. Any suggestions?
-
CincoPistolero
- Forum Newbie
- Posts: 6
- Joined: Thu Jun 23, 2005 4:30 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: