title: php database connection errors
body: <p>im hoping someone can help me quickly with a question i have.</p>
  
  <p>As site i have build is occasionally returning with the error</p>
  
  <p>Warning: mysqli::mysqli() [mysqli.mysqli]: (08004/1040): Too many connections in </p>
  
  <p>Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in </p>
  
  <p>Now at first i thought this was happening as i hadent closed the connection at the end of each page, now i get the connection like this at the beginning of a page / script</p>
  
  <p>$conn = new mysqli($host, $username, $password, $database);</p>
  
  <p>and at the very end call</p>
  
  <p>$conn->close();</p>
  
  <p>Also i close any result sets i have open.</p>
  
  <p>Looking at my log files around the time i accessed the site today and saw this error, I accessed about 12 o clock and at first the page wouldnt even load, then it gave me this error. before that one person visted around 11:30 and then 10:30, not exactly heavy traffic.</p>
  
  <p>The host I have gone with is very quiet and there is no way to get in contact with them, and ignoring any support emails, i thought maybe as now i hear they are not very good this could be an issue with a badly set up shared mysql server?</p>
  
  <p>Any thoughts or suggestions would be amazing as i need to sort this out!</p>
  
  <p>Thanks in advance!</p>