PHP 4.0 Bug #10181: odbc_result causes Unexpected network read error
| From: | f dot schneider at de-bleek dot demon dot nl | Date: | Thu, 05 Apr 2001 10:37:50 +0000 |
| Subject: | PHP 4.0 Bug #10181: odbc_result causes Unexpected network read error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-50928@lists.php.net to get a copy of this message | ||
From: f.schneider@de-bleek.demon.nl
Operating system: Linux
PHP version: 4.0.4pl1
PHP Bug Type: ODBC related
Bug description: odbc_result causes Unexpected network read error
Configuration bulld with
'./configure' '--with-openlink=/opt' '--sysconfdir=/etc'
'--with-apxs=/var/lib/apache/sbin/apxs'
Problem also occures when using --with-iodbc
The database I connect to is a Progress 7.3E15 database. Using the odbctest program all works fine:
i.e. it does not seem to be a problem with the openlink or iodbc code.
This is the code that results in the error
<HTML>
<HEAD>
<TITLE>Query ps_mstr</TITLE>
</HEAD>
<BODY>
<?php
$part = '9450001';
putenv("LD_LIBRARY_PATH=/opt/odbcsdk/lib");
putenv("ODBCINI=/etc/odbc.ini");
$dsn = "DSN=qaddb";
$sql = "select ps_comp from ps_mstr where ps_par = '$part'";
echo "<P>Query is $sql</P>\n";
if ($conn_id = odbc_connect("$dsn","","")) {
echo "<P>Database connection succeeded</P>\n";
if ($result = odbc_do($conn_id, "$sql")) {
echo "<P>Query succesfully submitted</P>\n";
/*
odbc_result_all($result);
*/
while (odbc_fetch_row($result)) {
$comp = odbc_result($result, 1);
echo "<P>$comp</P>\n";
}
odbc_free_result($result);
} else {
echo "<P>Problem submitting query</P>\n";
}
odbc_close($conn_id);
} else {
}
?>
Using lynx as a browser, I get the following errors:
Alert!: Unexpected network read error; connection aborted.
The code works fine if I give $part the value "STRATOS". It seems that the code breaks
when the query looks for records with key values that start with a number _and_ when more than one
row is being returned.
odbc_result_all also gives strange. The output with odbc_result_all and $part = 9450001 looks like:
ps_comp
Openlink_DSN=qaddb___2
Openlink_DSN=qaddb___2
Openlink_DSN=qaddb___2
Openlink_DSN=qaddb___2
Openlink_DSN=qaddb___2
The php.ini file is the same as php.ini-dist expect for output buffering being enabled.
Hope this helps
TIA
Frans Schneider
work: f.schneider@nido.nl
home: f.schneider@de-bleek.demon.nl
--
Edit Bug report at: http://bugs.php.net/?id=10181&edit=1