too many connections?

They have: 87 posts

Joined: Dec 2001

ok, i just re-coded newbie-developer.com and i got it running day b4 yesturday. whenever i try going there, i get an error saying "too many connections.... blah blah blah"... I dont think that i would be getting that much traffic right off. i surelly didn't get that problem b4. Is it my code? i make sure i freed all the results, and closed the database connection. what else is there do do? is it my host? how many connections should a host support? any help would be appreciated.

thank you

http://www.newbie-developer.com - Newbie web-developer community.

He has: 296 posts

Joined: May 2002

The error I get is:

Warning: MySQL Connection Failed: Too many connections in includes/mysql.php on line 41
Database error: Link-ID == false, connect failed
MySQL Error: 0 ()
Session halted.
'

That probably means that your file mysql.php file is trying to do to much on line 41. How 'bout letting us see the code, it will be easier to fix your problem then.

[James Logsdon]

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Funny the error I get is:

Warning: MySQL Connection Failed: Too many connections in includes/mysql.php on line 50
Database error: Link-ID == false, connect failed
MySQL Error: 0 ()
Session halted.
'

Usually this is a caused by too many connections to MySQL (duh). Is this site hosted by someone else or is it your own server. If it is your own server, you can increase the number of connections. If it is hosted by someone else, then they will need to troubleshoot it. Often times poorly written scripts that never close connections are part of the problem or a host trying to jam too many sites on a server.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 87 posts

Joined: Dec 2001

its gotto be my lame-*** host... because i made sure that the connection is closed everytime it get openned.

the reason one of you got the error on line 41 and then on line 50 is because i tried having it connect to a remote server, but it didn't work so i just commented out the info for the other DB and put in the code for the old DB. (if that made any sense Roll eyes )...

http://www.newbie-developer.com - Newbie web-developer community.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.