RE: PHP 4 + Mysq 4l - Too many connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How do you make the connection?

Ok the "too many connections" has nothing to do with the mysql_free_result,
Because you can do multiple queries over 1 connection.
The error specifically says that there are too much connections.

If you are using the mysql_pconnect(), the connection will stay open even
after the page terminates.
So check this first... And if so, use the mysql_connect().

You can also add to the bottom of every page the following:
mysql_close($link);   (where link is the mysql link)

Grtz

Rodrigo


-----Original Message-----
From: Rui Monteiro [mailto:ruismonteiro@xxxxxxxxx] 
Sent: vrijdag 15 juli 2005 15:27
To: php-windows@xxxxxxxxxxxxx
Subject:  PHP 4 + Mysq 4l - Too many connections

Hello there,

What is the correct way to clean the server memory after a mysql query? I
usually do this bellow:

----------------------------------------------------------
$res = mysql_query("select bla bla bla"); $row= mysql_fetch_array($res);

the code ...

mysql_free_result($res); #at the end
-----------------------------------------------------------

Still, there are times where my IIS server just crashes saying "too many
connections"

The mysql_connect is on a lib that I include in every file. Should I close
the connection on each end of page? If so, how?

By the way, if I make a query like this kind:

if(mysql_num_rows(mysql_query(bla bla bla))!=1)

Do I have to dump the result? If so, how?

Thanks a lot for your time,

Rui Monteiro

--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux