RE: [PHP-WIN] closing an ODBC connection to mysql
| From: | Asendorf, John | Date: | Tue, 18 Dec 2001 23:53:05 +0000 |
| Subject: | RE: [PHP-WIN] closing an ODBC connection to mysql | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11001@lists.php.net to get a copy of this message | ||
I know this may not be very helpful, but is there a reason you're not using
the native MySQL calls or adodb?
In the meantime, have you tried:
if ( !odbc_close($link) ) {
die ("connection not closed");
}
---------------------
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
> -----Original Message-----
> From: ben [mailto:bmf1@ukonline.co.uk]
> Sent: Tuesday, December 18, 2001 6:40 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] closing an ODBC connection to mysql
>
>
> Hello
>
> I've installed mysql and php on W2K with IIS5.0 and I'm
> having some trouble
> closing my connection, which is established via odbc.
>
> I have been using the following php code to connect:
>
> $link = odbc_connect("forum", "ben", "dulwich")
> or die("Could not connect");
> print "Connected successfully";
>
>
>
> This connects successfully. I then execute my query, which
> returns a result.
> All is fine so far.
>
> Unfortunately, when I come to close the connection, I have a problem:
>
> mysql_free_result ($result);
>
> print "Connection about to be closed";
> // Closing connection
> odbc_close($link)
> or die ("connection not closed");
> It always prints "connection not closed". Is this because the
> connection is
> not closing, or simply that the "or die" option is not
> applicable for the
> statement "odbc_close()"? I've read the manual and been
> through tutorials
> etc but haven't found any conclusive answers on this, and I'd
> be gratefull
> for any help!
>
> Thanks very much in advance.
>
> Ben
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>