php-windows Digest 18 Jul 2005 07:20:53 -0000 Issue 2730

Topics (messages 26209 through 26212):

PHP 4 + Mysq 4l - Too many connections
        26209 by: Rui Monteiro
        26211 by: Rodrigo
        26212 by: Louis Solomon [SteelBytes]

Re: File Download - php 4
        26210 by: Rodrigo

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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:[EMAIL PROTECTED] 
Sent: vrijdag 15 juli 2005 15:27
To: [email protected]
Subject: [PHP-WIN] 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

--- End Message ---
--- Begin Message ---
> Still, there are times where my IIS server just crashes saying "too many
> connections"

is this on XP Pro or 2000 Pro (as apposed to say 2000 or 2003 Server)
if so, that will be because IIS on workstations limits the number of 
simultaneous connectiuons to 10

-- 
Louis Solomon
www.SteelBytes.com

--- End Message ---
--- Begin Message ---
The following url will help you
http://www.php.net/features.file-upload

You just have to make a form and use the  enctype="multipart/form-data"

This will make the content available in the next php page.
Then you can write this content to a file (in this case, zip file)

Grtz

Rodrigo

-----Original Message-----
From: Rui Monteiro [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 15 juli 2005 15:26
To: [email protected]
Subject: [PHP-WIN] File Download - php 4

Hello there,

I want to make a form post where a user can send a *.zip file to the server.

How can I do this? I'm thinking on going for the ftp methd, but that would
be just too much work for a simple file send.

Any ideas?

Thanks a lot,

Rui

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

--- End Message ---

Reply via email to