function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RephraseRephrase 

Can't query Salesforce via API / PHP

Hi

 

I am having trouble querying Accounts in Salesforce via the API and a PHP script

 

I am getting the following error message

 

Fatal error: Call to undefined method stdClass::query()

 

The key part of my script is

 

// Connect
$client = new SforcePartnerClient();
$client->createConnection($wsdl);
$loginResult = $client->login($userName, $password);

// Query records
$query = "SELECT Id, FirstName, LastName, Phone from Contact";
$response = $loginResult->query($query);

 

Any suggestions?

 

Thanks

Frazer

amochkinamochkin
Just print_r($loginResult); and show us the result.