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

From: Date: Mon, 08 Jul 2002 18:30:37 +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-13541@lists.php.net to get a copy of this message
ID: 15600 Updated by: danny.heijl@cevi.be Reported By: keeper@fly.srk.fer.hr Status: Open Bug Type: Informix related Operating System: Solaris 7 PHP Version: 4.1.1 New Comment: According to Daniel Musante (danimu@hotmail.com) this is the fix: <quote> ifx.ec in the last version of php is missing in the function "ifx_query" the line: EXEC SQL set connection :ifx; after the line 777 775 sprintf(descrpid, "descrp%x", IFXG(cursorid)); 776 777 PHP_IFX_CHECK_CONNECTION(ifx); 778 779 EXEC SQL PREPARE :statemid FROM :statement; 780 </quote> I don't know who removed it, or why. Danny --- Previous Comments: ------------------------------------------------------------------------ [2002-06-20 08:28:12] keeper@fly.srk.fer.hr I tried using ifx_fetch_row($rid) (without NEXT or FIRST) but the problem remains. ------------------------------------------------------------------------ [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? ------------------------------------------------------------------------ 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 (#13541) next »