Jump to content

Fatal error on oci_parse()

Recommended Posts

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:


    echo "<html>\n<body>\n";
    echo "Attempting to connect to Oracle database.<br>\n";
    $conn1 = connectORA();
        echo "Error connecting to database.<br>\n";
        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
    echo "Results: <br>\n";
    $row = oci_fetch_assoc($stmt);
    echo "</body>\n</html>";

    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.
Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.