Results 1 to 2 of 2

Thread: Php and Oracle 9i

  1. #1

    Thread Starter
    Lively Member blackeyed's Avatar
    Join Date
    Nov 2002
    Location
    Chandigarh
    Posts
    118

    Php and Oracle 9i

    Hi all, I m totally new to PHP and i have to connect to oracle via php. I have Apache server running on my machine and php installed. But I am not able to connect to oracle via a sample PHP code. Can you pls guide me through. My code looks something like this.
    <html>
    If PHP is working, you will see "Hello World" below:<hr>
    <?php
    $conn = oci_new_connect('testdb, 'testdb123', 'testdb');
    $stid = oci_parse($conn, 'select sysdate from dual');
    oci_execute($stid);
    print '<table border="1">';
    while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS))
    { print '<tr>';
    foreach ($row as $item)
    {
    print '<td>'.($item?htmlentities($item):' ').'</td>';
    }
    print '</tr>'; }
    print '</table>'; ?>
    </html>

    only this line appears : "If PHP is working, you will see "Hello World" below:" Any help pls ..
    ~~Avi~~

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Php and Oracle 9i

    Please format your code using [php]code here[/php]
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width