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:

test.php:
[code]
<?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>";
?>[/code]

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

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 comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.