in reply to mySQL Times Out / Disconnects

I started Eliminating things for problem solving and after a few things, I found I was using $sth->finish; $dbh->disconnect();

after the while fetchrow_array() block, which causes some errors. Now I've updated it to:

$sth->finish if $sth; $dbh->disconnect() if $dbh;

Which now is giving me an error of "Too many connections" which I looked up:
http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html
and still don't know what to do about other than using module: Apache::DBI according to a super search I made