+ Reply to Thread
Results 1 to 4 of 4

Thread: Fatal error: Class 'QueryResult'

  1. #1

    Fatal error: Class 'QueryResult'

    Hi there
    i'm trying to populate some fields in a web form with salesforce data
    i get this error
    Fatal error: Class 'QueryResult' not found in C:\scripts\index.php on line 12

    from this code:


    require_once("c:/php/sforce/soapclient/SforceEnterpriseClient.php");
    require_once ('c:/php/sforce/soapclient/SforceHeaderOptions.php');
    require_once ('c:/php/sforce/userAuth.php');
    $conn= new SforceEnterpriseClient();
    $conn->createconnection("enterprise.wsdl.xml");
    $mylogin=$conn->login($myusername,$mypassword);
    $query="select firstname,lastname,email from contact where username__c='abcdefgh'";

    $response=$conn->query($query);
    $queryresult = new QueryResult($response);
    foreach ($queryresult->records as $result) {

    $Name= $result->fields->firstname;
    print_r("
    name is ");
    print_r ($Name);
    }

    thanks for any help
    tammy

  2. #2
    Join Date
    May 2007
    Posts
    506
    Blog Entries
    3
    Tammy thanks for joining the site and sorry for the delay in replying back to you. Are you sure that you are logging in alright? Usually when it cannot find class. Also i do not use the enterprise wsdl file at all, I stick with the partner wsdl. It is more flexible than the enterprise in my opinion

  3. #3
    hi mike
    i had copied code and that QueryResult class doesn't exist
    i removed that line and you were so right, once i started using the partner file and got the case right on my field names it worked!
    thanks
    tammy

  4. #4
    Join Date
    May 2007
    Posts
    506
    Blog Entries
    3
    Glad that worked.

+ Reply to Thread

Similar Threads

  1. Fatal error:[INVALID_LOGIN] INVALID_LOGIN:
    By lithiun in forum Salesforce PHP Tutorials
    Replies: 2
    Last Post: 10-07-2009, 03:18 PM
  2. SoapHeader fatal error
    By Baburaj in forum Salesforce PHP Tutorials
    Replies: 8
    Last Post: 05-23-2009, 09:10 AM
  3. sObject class?
    By eventhough in forum Salesforce Coding Discussions
    Replies: 2
    Last Post: 02-25-2009, 07:07 PM
  4. Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from
    By monloi in forum Salesforce Coding Discussions
    Replies: 2
    Last Post: 02-18-2009, 07:26 AM
  5. PHP Ajax class review for Open Technology Group
    By mike in forum Salesforce PHP Tutorials
    Replies: 2
    Last Post: 03-01-2008, 05:10 PM

Tags for this 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.0 RC1 PL1