php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #449 Oracle error in number of columns fetched
Submitted: 1998-06-10 16:53 UTC Modified: 1998-09-19 17:40 UTC
From: khapeman at skidmore dot edu Assigned:
Status: Closed Package: Oracle related
PHP Version: 3.0 Final Release OS: Solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: khapeman at skidmore dot edu
New email:
PHP Version: OS:

 

 [1998-06-10 16:53 UTC] khapeman at skidmore dot edu
In RC4 of php3, this function returned 129 in $ncols (correct value).  In th 3.0 final release it returns 1
<?
$conn = Ora_Logon("usr","pswd");
if ($conn < 0) {
    echo("Could not connect to Oracle.\n");
    exit;
}

$cursor = Ora_Open($conn);

if ($cursor < 0) {
    echo("Could not open a cursor.\n");
    Ora_Logoff($conn);
    exit;
}

Ora_CommitOff($conn);

$last = ereg_replace("'","''",$last);
if (Ora_Parse($cursor, "select * FROM people where last_name like 'Smit%'  and first_name like 'Jo%' and rownum < 2") < 0) {
    echo("Parse failed!\n");
    Ora_Logoff($conn);
    exit;
}

$ncols = Ora_Exec($cursor);
echo "Number of columns is $ncols\n";
$err = Ora_Fetch($cursor);
while ($err == 1) {
    $i = 0;
    while ($i < $ncols) {
        $col = Ora_GetColumn($cursor, $i);
        echo "got: $col (" . GetType($col) . ")<br>";
        echo "\n";
        $i++;
    }
    echo "\n";
    $err = Ora_Fetch($cursor);
}

Ora_Close($cursor);
Ora_Logoff($conn);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-09-19 17:40 UTC] rasmus
Use ora_numcols()
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Nov 26 16:01:23 2020 UTC