<?php
if ($connection = @mysql_connect($host, $username, $password)){
 @mysql_close($connection);
}
?>

By this way, you always reopne a new connection at the end of all of your
page....

You just have to use somthing like this...
if($connection)
    @mysql_close($connection);

But as it was said, you are not *obliged* to close the connection, PHP will
close it himself.
But you can also close your connection manually on each page just after you
send your last request.

"Shaun" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> hi,
>
> I include a file called bottom.php which goes at the bottom of all my
pages
> and looks like this:
>
>     <td>&nbsp;</td>
>   </tr>
>  </table>
> </body>
> </html>
> <?php
> if ($connection = @mysql_connect($host, $username, $password)){
>  @mysql_close($connection);
> }
> ?>
>
> I use this to make sure that I haven't left a connection open
accidentally,
> however I sometimes get an error message even though I am using the @
> symbol:
>
>
> Warning: mysql_close(): no MySQL-Link resource supplied in
> /home/w/o/workmanagement/public_html/authenticate_user.php on line 51
>
> How can this be?
>
>



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

Reply via email to