php - Error executing simple select query on salesforce -


i'm new on salesforce , php, i'm trying execute query,

<?php  define("username", "mymail"); define("password", "mypass"); define("security_token", "mytoken");  require_once ('soapclient/sforcepartnerclient.php');   $mysforceconnection = new sforcepartnerclient(); $mysforceconnection->createconnection("wsdl.jsp.xml"); $mysforceconnection->login(username, password.security_token);   $query = "select email__c user__c"; $response = $mysforceconnection->query($query); $queryresult = new queryresult($response); ?> 

but error:

fatal error: uncaught soapfault exception: [soapenv:client] element {}item invalid @ location in /library/webserver/documents/force/soapclient/sforcebaseclient.php:797 stack trace: #0 /library/webserver/documents/force/soapclient/sforcebaseclient.php(797): soapclient->__call('query', array) #1 /library/webserver/documents/force/soapclient/sforcebaseclient.php(797): sforcesoapclient->query(array) #2 /library/webserver/documents/force/dummy.php(18): sforcebaseclient->query('select email__c...') #3 {main} thrown in /library/webserver/documents/force/soapclient/sforcebaseclient.php on line 797 

i'm not sure i'm doing wrong. basically, im using workbench soql salesforce, , query works good. wrong? in advanced

it looks sales force query should work - i'm not familiar "queryresult" function, perhaps try dump line , see if works. may 1 result, iterate through records this:

// iterate through sf records foreach ($response->records $record) {     //do $record here.     print_r($record); } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -