From: [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version: 4.0.4pl1
PHP Bug Type: ODBC related
Bug description: Error in ODBC to Connect Progress Database
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;
____________________
--
Edit Bug report at: http://bugs.php.net/?id=9696&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]