since you have NOT posted your PHP code, I would be able to give only tentative answers. You can try and see if you are closing db connections properly, this error means there is either a lot of traffic to your website or the old connections are not being disposed properly.
EDIT: found this link that talks about your kind of problem
too many connections[
^]