php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9696 Error in ODBC to Connect Progress Database
Submitted: 2001-03-12 03:43 UTC Modified: 2001-05-12 15:35 UTC
From: siroh at sina dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.4pl1 OS: Windows 2000
Private report: No CVE-ID: None
 [2001-03-12 03:43 UTC] siroh at sina dot com
There is an error to via an ODBC driver, "INTERSOLV DataDirect
Connect ODBC PROGRESS Driver for Microsoft Windows 95 and 
Microsoft Windows NT, Version 3.11", to use Progress Database.

PHP Version:              4.0.4pl1
OS:                       Windows 2000 5.00.2195
ODBC Version:             3.520.4403.2
ODBC Progress Driver:     INTERSOLV DataDirect Connect ODBC 
                          PROGRESS Driver for Microsoft Win
                          dows 95 and Microsoft Windows NT,
                          Version 3.11"


PHP.INI
_____________
......

odbc.allow_persistent	=	ON
odbc.check_persistent  	= 	ON
odbc.max_persistent		=	-1	
odbc.max_links			=	-1
odbc.defaultlrl			=	4096	
odbc.defaultbinmode		= 	1	

......
_____________



The script are following, and mark the state in some step.
_____________________

<?php

$dsn = "TEST";
$uid = "test";
$pwd = "test";

# ODBC DSN Config


$lid = odbc_connect($dsn,$uid,$pwd);

# Connect to DSN. OK.


$sql = "select part from mstr where part like 'VB%'";

$rid = odbc_do($lid,$sql);

# Do the query. OK


header("content-type:text/html;charset=iso8859-1");

echo "<table border=1>\n";
while (odbc_fetch_row($rid)){
	$pt = odbc_result($rid,1);
	echo "<tr><td>$pt</td></tr>\n";
}
echo "</table>";

# Here, odbc_fetch_row() always is TRUE. I must use the STOP of
# the browser to stop. And the Value of $pt is or NULL.

odbc_close($lid);

?>

______________________


There output HTML Source is following:

______________________


<table><tr><th>pt_part</th></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>

_______________________


But, the same process on Perl is OK.

The Perl Script is following:

________________________
#!perl
print ("Content-type: text/html\n\n");

use Win32::ODBC;

$DSN = "DSN=test;UID=test;PWD=test";

$data = new Win32::ODBC($DSN);
if (!$data->Connection) {
	print $db_connect_error;
	Win32::ODBC::DumpError;
	die;
}

$sql = "select part from mstr where part like 'VB%'";

if ($data->Sql($sql)) {
	print $sql_error;
	Win32::ODBC::DumpError;
}

@field = $data->FieldNames;
$sum = @field;

print "<table border=1>\n<tr>";
for ($i=0; $i<$sum; $i++) {
	print "<td>$field[$i]</td>";	
}
print "</tr>\n";

while ($data -> FetchRow) {
	print "<tr>";
	@da=$data->Data;
	for ($i=0; $i<$sum; $i++) {
		print "<td>$da[$i]</td>";
	}
	print "</tr>\n";
}

print "</table>\n\n";

$data->Close;
____________________

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-22 23:14 UTC] kalowsky@php.net
multiple parts.

1) have you tried this with any of the 4.0.5RCs?

2) have you tried using odbc_num_rows to identify how many 
rows you have returned?  and with that looping through your 
odbc_fetch_row using an row specifier?  
 [2001-05-12 15:35 UTC] kalowsky@php.net
no user feedback.  considered fixed.  if untrue, please
reopen the bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC