|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10302 odbc_tables()
Submitted: 2001-04-12 10:47 UTC Modified: 2002-02-04 15:35 UTC
From: john at milnedunn dot netscapeonline dot co dot uk Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 4.0.4pl1 OS: winnt4sp6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2001-04-12 10:47 UTC] john at milnedunn dot netscapeonline dot co dot uk
I think this may have been an issue in a previous release but I am still having it in this version.

after calling odbc_tables() I can not get the results using odbc_fetch_row() or odbc_result_all(), but odbc_num_rows() does return the number of tables in the database.

The system is using the precomplied version downloaded from zend with the default php.ini file. Oh and in ISAPI mode!



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-18 21:37 UTC]
can you please provide a sample script on how to reproduce this?
 [2001-04-23 12:27 UTC] john at milnedunn dot netscapeonline dot co dot uk
code example:-

$dsn="php";	// System DSN
$db = odbc_connect($dsn,$user,$passwd);
if(!$db) {
	echo "SORRY: could not connect to database<br>";

// get table list

$result = odbc_tables($db);
if($result) {

               // debug lines
	echo odbc_num_rows($result) . " Tables found <br>";
               // end debug

	while(($report = odbc_fetch_row($result))) {
		$row[$count] = odbc_result($result,3);

	if($count > 0) {
		for(reset($row);$table_list[]=current($row);next($row)) { }
	} else {
		echo "SORRY. I Can't Get The Table Details<br>";

// get field names

$result = odbc_columns($db,"","","$tables");
if($result) {
	while(($report = odbc_fetch_row($result))) {
		$row[$count] = odbc_result($result,4);

	if($count > 0) {
		for(reset($row);$columns[]=current($row);next($row)) {}
	} else {
		echo "SORRY. I Can't Get The Field Details<br>";


odbc_num_rows() returns a count of tables in the database,
odbc_results_all() returns no rows,
odbc_fetch_row() returns false.

 [2001-05-16 02:51 UTC] john at milnedunn dot netscapeonline dot co dot uk
I have just updated php to 4.0.5 with the same results.
I also added odbc_error() and odbc_errormsg() after the 
'SORRY . I Cant't Get The Table Details' message, and they return empty stings.

 [2001-05-16 04:24 UTC] john at milnedunn dot netscapeonline dot co dot uk

The same script works fine using the CGI interface.
If I select the reload page button on the browser, it works using ISAPI about 1 in 5 times!

 [2002-01-13 07:14 UTC]
Can you reproduce this error with 4.1.1?
 [2002-02-04 15:35 UTC]
No feedback was provided for this bug, so it is being suspended.
If you are able to provide the information that was requested,
please do so and change the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 15:01:28 2024 UTC