Bug #15600 Updated: ifx_fetch_row return the same tuple more than once

From: Date: Thu, 20 Jun 2002 12:28:12 +0000
Subject: Bug #15600 Updated: ifx_fetch_row return the same tuple more than once
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11559@lists.php.net to get a copy of this message
ID: 15600 Updated by: keeper@fly.srk.fer.hr Reported By: keeper@fly.srk.fer.hr -Status: Feedback +Status: Open Bug Type: Informix related Operating System: Solaris 7 PHP Version: 4.1.1 New Comment: I tried using ifx_fetch_row($rid) (without NEXT or FIRST) but the problem remains. Previous Comments: ------------------------------------------------------------------------ [2002-06-20 07:31:17] derick@php.net From the manual: position is an optional parameter for a "fetch" operation on "scroll" cursors: "NEXT", "PREVIOUS", "CURRENT", "FIRST", "LAST" or a number. If you specify a number, an "absolute" row fetch is executed. This parameter is optional, and only valid for SCROLL cursors. You're not using a SCROLL cursor (no parameter to ifx_prepare). Just use ifx_fetch_row($rid) (without NEXT) and it should work fine. Please test this, and report back. Derick ------------------------------------------------------------------------ [2002-06-20 06:55:33] keeper@fly.srk.fer.hr php 4.2.1 has the same problem. ------------------------------------------------------------------------ [2002-02-20 04:17:51] keeper@fly.srk.fer.hr Of course. Here it is: $conn_id=ifx_connect ("prirodo2@nippurtcp", "user", "password"); if (! $conn_id) { echo "<b>Ne mogu se spojiti na bazu</b>"; exit; } $rid = ifx_prepare ($select, $conn_id); if (! $rid) { printf("Do&#353lo je do pogre&#353ke u radu\n"); zavrsi($conn_id); } if (! ifx_do ($rid)) { printf("Ne mogu izvr&#353iti upit nad bazom podataka\n"); zavrsi($conn_id); } $row = ifx_fetch_row ($rid, "FIRST"); while (is_array($row)) { for (reset($row); $fieldname = key($row); next($row)) { $rez = array_values($row); echo $rez[0]; } $row = ifx_fetch_row ($rid, "NEXT"); } $rowcount = ifx_num_rows($rid); ifx_free_result ($rid); ifx_close ($conn_id); ------------------------------------------------------------------------ [2002-02-19 14:09:26] sander@php.net Can you provide a simple, self-contained (byt complete) sample script? ------------------------------------------------------------------------ [2002-02-19 03:25:31] keeper@fly.srk.fer.hr I wanted to list the reseults from the query from the database. I got one tuple as a result. ifx_num_rows returns 1 at the end of the listing the results. But, I got 4 same tuples on the output. I used the structure for ifx_fetch_row as described in the example in documantation. The structure: $row = ifx_fetch_row ($rid, "FIRST"); while (is_array($row)) ... is not working properly... As I already pointed out, it was all working just fine in php 4.0.5 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15600 -- Edit this bug report at http://bugs.php.net/?id=15600&edit=1

« previous php.bugs (#11559) next »