+ 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.