Bug #14216 Updated: odbc_tables() does not close automatically ODBC MSAccess connection
| From: | derick@php.net | Date: | Sat, 25 May 2002 00:30:07 +0000 |
| Subject: | Bug #14216 Updated: odbc_tables() does not close automatically ODBC MSAccess connection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-8474@lists.php.net to get a copy of this message | ||
ID: 14216
Updated by: derick@php.net
Reported By: astelix@libero.it
-Status: Open
+Status: Bogus
Bug Type: ODBC related
Operating System: Windows 2000
PHP Version: 4.0.6
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2001-11-25 07:20:13] astelix@libero.it
This is a bug report and, i think, also a solution report. If u use the
canonical syntax to retrieve table names from a Microsoft Access ODBC
connection on windows 2K (dunno if this happen with previous versions)
using ZEND PHP 4.0.6 engine, you will see your page to fall in a deep
endless loop without waking up. The workaround, that is also a good
coding practice, is to close all you left open: so use odbc_close_all()
and your sleepy page turn to wake up without a prob!
Here it is my piece of code to accomplish the whole job:
<script language="php">
//
// ODBC database table names retrieve with odbc_tables()
//
error_reporting (E_ALL);
$the_connection="test";
$ODBCConn=odbc_connect($the_connection, "", "",SQL_CUR_USE_ODBC) or
die("DSN error!");
$i=0;
$recordset=odbc_tables($ODBCConn);
while(odbc_fetch_row($recordset))
{
// In MSAccess the first 5 tables are used by the application and
we don't care of them
if (++$i <= 5) echo ":: SYSTEM TABLE :: ";
echo odbc_result($recordset, "TABLE_NAME")."<br>\n";
}
flush(); // this is merely optional
odbc_close_all(); // don't forget this!!!
</script>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14216&edit=1