Re: Database connections

From: Date: Mon, 02 Apr 2001 12:12:36 +0000
Subject: Re: Database connections
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-46596@lists.php.net to get a copy of this message
You don't have to call mysql_close(). PHP handles cleaning resources when script execution is ended. You can set default connection parameters for MySQL in php.ini. I don't know if you need to call mysql_connect(). (I don't use MySQL :) Regards, -- Yasuo Ohgaki ""David Hynes"" <david@fed202.com> wrote in message news:NEBBKPMCELLJJBPCHMGPGEILCBAA.david@fed202.com... > I'm using PHP on a windows box to access a MySQL database. > > I noticed that I do not need to open a database connection before performing > a mysql_db_query(). Is this bad coding ? Should the database connection > always be made ? Is this specific to Windows ? > > # $databaseConnection = mysql_connect ("localhost", "", ""); ## > I don't > seem to need this line, or the last one > mysql_db_query("dbnam", "SQL query"); > # mysql_close ($databaseConnection); > > Thanks, > David. > > ----------------------- > Fed202 Solutions > www.fed202solutions.com > Mobile : 07779 293368 > ----------------------- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#46596) next »