+ Reply to Thread
Results 1 to 2 of 2

Thread: Connection to database

  1. #1
    danielmastrangelo is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Connection to database

    Hello. I'm new to this API but I didn't think that what we're trying to do would be this complicated and I ran into an issue here. I've been researching online all day and haven't found anything. As you can see in my code I put a few echo lines in there to see where I'm getting and it's breaking on the $recordSet = $conn->query($sql); line and stopping there without returning an error. The username and password are normally there - I blanked them out for the post. I would assume that it has something to do with the "database user" that needs to be our username but I figured that the variables would have been used there if I had to change it and I don't know what we'd have to put for the "database" either. Thanks.


    <?php
    session_start();
    $errors = null;
    ini_set("soap.wsdl_cache_enabled", "0");
    require_once ('./soapclient/SforcePartnerClient.php');
    require_once ('./soapclient/SforceHeaderOptions.php');
    $wsdl = './soapclient/partner.wsdl.xml';
    $userName = "";
    $password = "";
    $client = new SforcePartnerClient();
    $client->createConnection($wsdl);
    $loginResult = $client->login($userName, $password);
    if ($loginResult)
    {
    echo "I am logged in";
    }
    else
    {
    echo "someting is wrong";
    }
    $_SESSION['location'] = $client->getLocation();
    $_SESSION['sessionId'] = $client->getSessionId();
    $_SESSION['wsdl'] = $wsdl;
    require_once ('./soapclient/adodb.inc.php');
    $conn = ADONewConnection("oci8");
    echo "here1";
    $_ret = $conn->Connect('', "database user", "password", "database");
    echo "here2";
    $sql = "SELECT Name FROM Account";
    echo "here3";
    $recordSet = $conn->query($sql);
    echo "here4";
    echo "<table>";
    $i = 0;
    while ($row = $recordSet->FetchRow())
    {
    echo "<tr>";
    echo "<td>$i</td>";
    echo "</tr>";
    $i++;
    }
    echo "here";
    echo "</table>";
    ?>

  2. #2
    danielmastrangelo is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2
    nevermind - I figured out that I was doing it completely wrong.

+ Reply to Thread

Bookmarks

Posting Permissions

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

SEO by vBSEO 3.5.1