Originally posted by Gary Kambic
Is there any way around this message "Too many connections" or will the folks just have to refresh and try the page again?
A couple of thoughts occur to me.
First, minimise the amount of time spent connected - put off connecting as long as possible, do all (or at least as much as possible) of the database interaction in one go (so that the connection isn't sitting idle between queries), and close the connection as soon as you're done (instead of leaving it to be closed automatically when the script ends). If that means gathering results into arrays now and using them later on in the appropriate place in the script - there's no harm in doing so.
Second is of course to make sure your queries are as streamlined as you can manage; that they only return exactly what you need; minimise the amount of stuff that has to be sent through the connection. Other techniques to speed up the queries themselves (such as indexing) should be experimented with.
If you've got pages that are only updated occasionally, yet still drawn from the database, consider caching them: when the table is updated, a static copy of the updated portion of the page is saved to the filesystem (as static HTML, say, though PHP could be included); when the page is requested, the saved portion is included instead - and that's one less spot where you need a database connection.
And after all this, remember that if you're on a shared server chances are that yours isn't the only site trying to connect at any given time. Maybe someone else is the dbms hog.