Posted by Tony Marston on 06/27/05 11:14
<ndsoumah@gmail.com> wrote in message
news:1119809399.642107.214020@f14g2000cwb.googlegroups.com...
> ok. basically are telling me to do something like this:
>
> function establishConnection ()
> {
> if ( !$connection = @mysql_connect("localhost","root") )
> die ("Echec de la connection");
>
> // Je selectionne la base de donnees
>
> if ( !(@mysql_select_db("djoubarn_Emploi",$connection)))
> showerror();
> return $connection;
>
> }
>
>
> then save this routine in an include file and call it on every page?
> if so , it doesn't matter that the database was never closed?
Just because you do not explicitly close the database connection does it
remain open. When the PHP script terminates all resources are closed
automatically. However, it is good programming practice to close a
file/connection when you have finished with it.
--
Tony Marston
http://www.tonymarston.net
[Back to original message]
|