Bug #17572 Updated: Calling odbc_tables crashes
| From: | grangeway at hotmail dot com | Date: | Fri, 14 Jun 2002 19:01:14 +0000 |
| Subject: | Bug #17572 Updated: Calling odbc_tables crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10465@lists.php.net to get a copy of this message | ||
ID: 17572
Updated by: grangeway@hotmail.com
Reported By: jma@jma.se
Status: Open
Bug Type: ODBC related
Operating System: W2K, FP2
PHP Version: 4.2.1
New Comment:
A shorter version of this crash is :
$ms = odbc_connect("moo", "", "");
$th = odbc_tables ($ms);
while (odbc_fetch_row($th))
{
odbc_free_result($th);
}
Previous Comments:
------------------------------------------------------------------------
[2002-06-12 17:58:04] mwilmes@avc.edu
I've tried this on two platforms W98 using Xitami, and W2K using
iPlanet, but my bug is slightly different: My ODBC drivers don't load,
error IM003. But those ODBC drivers worked with Access and an Oracle
frontend. The W2K was a fresh install this morning with the ODBC
drivers and PHP. This problem was resolved on BOTH platforms by
retrograding to 4.2.0.
------------------------------------------------------------------------
[2002-06-05 05:25:55] jma@jma.se
Tried the php4-win32-200206031400.zip build but the excat same thing
happened :-(
/JMA
------------------------------------------------------------------------
[2002-06-03 06:29:24] derick@php.net
Can you please try a non-stable snapshot from snaps.php.net/win32 and
report back if it works?
Please do not forget to update your php4ts.dll.
Derick
------------------------------------------------------------------------
[2002-06-03 06:26:13] jma@jma.se
This script crashes after showing the first table.
This is consistant on several ODBC sources (tried Access, Foxpro and
DB2).
This script worked with 4.0 versions.
<?php
$host = ""; // Enter your ODBC connection here
$uid = "";
$pwd = "";
$ms = odbc_connect($host, $uid, $pwd);
$th = odbc_tables ($ms);
while (odbc_fetch_row($th))
{
if (odbc_result($th, "TABLE_TYPE") == "TABLE")
{
$table = odbc_result($th, "TABLE_NAME");
printf("<H2>%s</H2>\n", $table);
$fh = odbc_columns($ms);
echo "<BLOCKQUOTE>\n";
echo "<TABLE BORDER=0 CELLPADDING=10>\n";
while (odbc_fetch_row($fh))
{
if (odbc_result($fh, "TABLE_NAME") == $table)
{
printf("<TR>");
printf("<TD>%s</TD>", odbc_result($fh,
"TYPE_NAME"));
printf("<TD><B>%s</B></TD>",
odbc_result($fh,
"COLUMN_NAME"));
switch (odbc_result($fh, "DATA_TYPE"))
{
default:
}
printf("</TR>\n");
}
}
echo "</TABLE>\n";
echo "</BLOCKQUOTE>\n";
odbc_free_result($th);
}
}
odbc_free_result($th);
odbc_close ($ms);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17572&edit=1