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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

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