Jump to content


Photo

Fatal error on oci_parse()


  • Please log in to reply
No replies to this topic

#1 Daen

Daen
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 04 May 2006 - 11:51 PM

I'm running XAMPP on my machine (localhost), and Oracle on another server:
ApacheFriends XAMPP (basic package) version 1.5.2

+ Apache 2.2.0
+ PHP 5.1.2 + PHP 4.4.2-pl1 + PEAR

Ok, here's my code:

test.php:
<?php
    include('include/connectORA.php');

    echo "<html>\n<body>\n";
    
    echo "Attempting to connect to Oracle database.<br>\n";
    
    $conn1 = connectORA();
    
    if(!$conn1)
        echo "Error connecting to database.<br>\n";
    else
        echo "Successful!<br>\n";
    
    echo "<br>Attempting to select data from database.<br>\n";
    
    $table = "PERSON";
    
    $sql = "SELECT * FROM ".$table;
    
    $stmt = oci_parse($conn1, $sql);   // <-- has problem right here
    oci_execute($stmt);
    
    echo "Results: <br>\n";
    
    $row = oci_fetch_assoc($stmt);
    
    print_r($row);
        
    echo "</body>\n</html>";
?>

connectORA.php
<?php
    function connectORA()
    {
        $db = "MYNAME";
        return ocilogon("mydb", "mypass", $db);
    }
?>

When I run it in Firefox, Apache gives me the following error "Apache HTTP Server has encountered a problem and needs to close." Then it tells me that the document has no data in it, and Apache keeps running afterward. Kinda strange it tells me it crashed, and then doesn't.

If I comment out the lines after $sql = "..."; then it works just fine, and I even get a connection successful notice. If I uncomment oci_parse(), then it gives me the error again.

Does anybody know what might be causing this?

Am I maybe getting a bad connection, even though $conn1 isn't null?

I appreciate any help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users