ID: 2688 Updated by: [EMAIL PROTECTED] Reported By: tommy at webontap dot com -Status: Open +Status: Wont fix Bug Type: OCI8 related Operating System: NT4 PHP Version: 3.0.12
Previous Comments: ------------------------------------------------------------------------ [2005-03-30 09:00:15] [EMAIL PROTECTED] We are sorry, but we can not support PHP 3 related problems anymore. Momentum is gathering for PHP 5, and we think supporting PHP 3 will lead to a waste of resources which we want to put into getting PHP 5 ready. Of course PHP 4 will continue to be supported for the forseeable future. ------------------------------------------------------------------------ [1999-11-08 16:01:36] tommy at webontap dot com code below, works as expected: /*--------------------------------------------------*/ $query = "SELECT * FROM USERS"; $conn = OCILogon("username", "passwd", "db"); $stmt = OCIParse($conn, $query); OCIExecute($stmt); while (OCIFetchInto($stmt, &$row, OCI_ASSOC)) { echo $row["LASTNAME"] . ", " . $row["FIRSTNAME"] . "<br>"; } OCIFreeStatement($stmt); OCILogoff($conn); /*--------------------------------------------------*/ HOWEVER... THIS code below, does not: /*--------------------------------------------------*/ function getusers() { $query = "SELECT * FROM USERS"; $conn = OCILogon("username", "passwd", "db"); $stmt = OCIParse($conn, $query); OCIExecute($stmt); while (OCIFetchInto($stmt, &$row, OCI_ASSOC)) { echo $row["LASTNAME"] . ", " . $row["FIRSTNAME"] . "<br>"; } OCIFreeStatement($stmt); OCILogoff($conn); } /*--------------------------------------------------*/ After tearing my hair out for an hour, i tried THIS: /*--------------------------------------------------*/ function getusers() { $query = "SELECT * FROM USERS"; $conn = OCILogon("username", "passwd", "db"); $stmt = OCIParse($conn, $query); OCIExecute($stmt); while (OCIFetchInto($stmt, &$row, OCI_ASSOC)) { echo $row[0] . ", " . $row[1] . "<br>"; } OCIFreeStatement($stmt); OCILogoff($conn); } /*--------------------------------------------------*/ REGARDLESS of using OCI_ASSOC or OCI_NUM, the OCIFetchInto called from within the FUNCTION returned an enumerative 0-based array into $row, whereas the OCIFetchInto called in the ordinary code (using OCI_ASSOC) returned an associative array into $row. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=2688&edit=1