|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-07 15:49 UTC] dri at fadq dot qc dot ca
Description: ------------ Db2_connect V9.5 enterprise and connect to AS400 Although the first call to db2_result() returns the correct value, an immediate second call to db2_result() with the same parameters returns an empty string. Reproduce code: --------------- $IDconnect = db2_connect(...); $reqSQL = "SELECT * FROM $g_libl.TABLE1 WHERE REGNUM=33"; $res=db2_exec($IDconnect,$reqSQL); $row = db2_fetch_row($res); echo '<br>REGNUM:'.db2_result($res,"REGNUM"); echo '<br>REGNUM:'.db2_result($res,"REGNUM"); echo '<br>REGNUM:'.db2_result($res,0); echo '<br>REGNUM:'.db2_result($res,0); Expected result: ---------------- REGNUM:33 REGNUM:33 REGNUM:33 REGNUM:33 Actual result: -------------- REGNUM:33 REGNUM: REGNUM: REGNUM: PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 11:00:01 2025 UTC |
Hi, I tried a very simple program and found it working properly against AS400. Can you send the CLI trace for the following test case: <?php $conn = db2_connect (...); if($conn) { $stmt = @db2_exec($conn, "CREATE TABLE TEST_13338 (ID INTEGER NOT NULL, NAME VARCHAR(20))"); $stmt = @db2_exec($conn, "INSERT INTO TEST_13338 (ID, NAME) VALUES (0, 'TEMP 0'), (1, 'TEMP 1'), (2, 'TEMP 2')"); $sql = "SELECT * FROM TEST_13338 WHERE ID = 0"; $stmt = db2_exec ($conn, $sql); db2_fetch_row($stmt); echo "ID:\t" . db2_result($stmt, 0) . "\n"; echo "ID:\t" . db2_result($stmt, 0) . "\n"; echo "ID:\t" . db2_result($stmt, "ID") . "\n"; echo "ID:\t" . db2_result($stmt, "ID") . "\n"; $stmt = @db2_exec($conn, "DROP TABLE TEST_13338"); db2_close($conn); } else { print "Connection Failed." . "\n"; } ?> I am getting of above example as: ID: 0 ID: 0 ID: 0 ID: 0 Regards, Ambrish Bhargava