RE: [PHP-DEV] PHP 4.0 Bug #5719: lost result entry when using sybase_fetch_row()
| From: | Pretlow L. Stevenson III | Date: | Sat, 22 Jul 2000 17:39:00 +0000 |
| Subject: | RE: [PHP-DEV] PHP 4.0 Bug #5719: lost result entry when using sybase_fetch_row() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25442@lists.php.net to get a copy of this message | ||
Torsten,
From your system description it seems you are not using the Sybase
CT-Library. We were experiencing similar problems and had to switch over to
the CT-Library before they were corrected (we were using the DB Library). It
seems to be the consensus of the list that the CT Library is the better
choice [offering more functionality], and should eliminate your missing
result problem. To include CT Library support you will need to use the
config option:
--with-sybase-ct=<DIR>
All this said, I'm assuming your code doesn't contain errors. :-) I had to
debug my code for days before realizing it wasn't the code, but the DB
Library. Hope that helps.
Pret
-----Original Message-----
From: torsten.weigel@dresdner-bank.com
[mailto:torsten.weigel@dresdner-bank.com]
Sent: Friday, July 21, 2000 4:42 AM
To: php-dev@lists.php.net
Subject: [PHP-DEV] PHP 4.0 Bug #5719: lost result entry when using
sybase_fetch_row()
From: torsten.weigel@dresdner-bank.com
Operating system: Solaris 2.6
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Sybase (dblib) related
Bug description: lost result entry when using sybase_fetch_row()
system decription:
- SUN E450 4xUltraSparc II 250 MHz, 1GB memory
- Solaris 2.6 (all recomended patches)
- Sybase Adaptive Server Enterprise/11.9.2/1031/P/Sun_svr4/OS
5.5.1/FBO/Fri Aug 14 06:26:45 1998
php configuration line:
./configure \
--with-apxs=/opt/apache/bin/apxs \
--with-config-file-path=/opt/apache/conf \
--with-mm=../../mm-1.1.2/mm-binary \
--without-mysql \
--with-sybase=/opt/db/sybase/sybase11.9.2 \
--with-pdflib=/usr/local/lib \
--with-gd=../addons/gd-1.8.3 \
--with-jpeg-dir=/usr/local \
--with-xpm-dir=/usr/local \
--with-ttf=/usr/local \
--with-mhash=/usr/local \
--enable-libgcc \
--enable-track-vars \
--enable-url-includes
sample script:
<?php
$db_id=sybase_connect("DSCOMPONENTS_DEV", "", "");
if(!$db_id) {
print ("Connect to database fails<BR>");
} else {
print ("Connection established<BR>");
$rc=sybase_select_db("master");
$db_result=sybase_query("select * from sysusers order by name");
$selected_rows=sybase_num_rows($db_result);
print ("Selected Rows= $selected_rows<BR>");
/*Funny stuff !! Activate the next line and fix the problem*/
/*$rc=sybase_data_seek($db_result,0);*/
while ($db_row = sybase_fetch_row($db_result)) {
print (implode($db_row, " : "));
print ("<BR>");
}
}
?>
description:
The sample script loses usually the second result line. If the error does
not turn up in the first time, make a reload for the same page an then you
got it. It is not relevant how to order the result, everytime the second
line is empty.
The line with the sybase_data_seek-statement fixes the problem.
Regards
Torsten
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net