Re: mySQL Too Many Connections Open error
Hey Getmea,
I had the same error message before. The site I built, (PHP) had connection statements on various pages, with close connection statements. But, for some reason the "Too many connctions" error would pop up. I fixed the problem by making the Open and Close connection statements a function. Then, just included the function call on the top of the index page and at the bottom of the index page. The site was built with all includes. So, by putting Open at the top of the index page, the function was available to all the included pages. Does that make sense? Its just a house cleaning tactic. Organization thing a ma jig.
Example:
<?php include ("constants.php");?>
<?php include ("functions.php");?>
<?php fnOpenDBConnection(); ?>
<html>
<head>
</head>
<table width="100%" cellpadding="0" cellspacing="0" height="100%" class="">
<tr valign="top">
<td align="center" valign="top" height="181">
<?php include ("includes/incHeader.php"); ?></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" height="100%" class="">
<tr>
<td align="center" valign="top">
<?php include ("includes/incMainbody.php"); ?></td>
</tr>
<tr>
<td align="center" height="40">
<?php include ("includes/incFooter.php"); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<?php fnCloseDBConnection(); ?>
</html>
Peace out
Giziis
|