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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 4 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC