Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    11

    Unanswered: problem connecting to adodb

    Hi,

    Im using PHP and Dreamweaver to connect to a back end database created using SQL++. I have downloaded the adodb library to this directory "C:\adodb\". I have PHP4 and apache server installed and they are working fine and dandy. I have created all the tables and populated them with data and I have tried the basic example (shown below) to extract some data from the database.

    'oracle' being my host string, 'c3008212' and 'abtab8' being my password to log into SQL++ (Im currently running Oracle 9i).

    <?php
    include('c:/adodb/adodb.inc.php');
    echo "(1) Open the database connection and use the winestore database ";
    $conn = ADONewConnection('oci8'); //Create the connection to Oracle
    $conn->PConnect('oracle','c3008212','abtab8', "winestore");

    echo "\n(2) Execute the query on the winestore through the connection, putting results ";
    // into a recordset

    $conn->SetFetchMode(ADODB_FETCH_ASSOC);
    $recordSet = $conn->Execute('SELECT * FROM wine');
    //Check for errors
    if (!$recordSet)
    print $conn->ErrorMsg();
    else
    echo "\n(3) While there are still rows in the recordset, fetch the next record <br>";
    while (!$recordSet->EOF) {
    //(4) Print each element in the recordset
    print $recordSet->fields['WINE_ID'].' '.$recordSet->fields['WINE_NAME'].'<BR>';
    $recordSet->MoveNext();
    }
    // (5) Close the connection
    $recordSet->Close(); # optional
    $conn->Close(); # optional
    ?>

    The only things that show on the page are these 2 lines:

    (1) Open the database connection and use the winestore database
    (2) Execute the query on the winestore through the connection, putting results

    Please can somebody help and tell me where i am going wrong. Thank you for your time.

    Colin

  2. #2
    Join Date
    Mar 2004
    Posts
    42

    Talking

    I had a similar problem but at uni. Have you commited your data after running the ddl?

    Your from LMU if im correct in thinking?



    Jon

Posting Permissions

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