You need to sign in to do that
Don't have an account?
M.
sforce php query
Hello everyone....
I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?
I'm ussing a login code, and then this...
try
{
$result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
print_r($result);
print "I'm not reaching this print";
} catch (Exception $e)
{
print_r($e);
}
what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you
M.
I'm trying to query the salesforce database... I can successfuly login into the salesforce, but there seems to be something wrong with the query... can anybody help me here?
I'm ussing a login code, and then this...
try
{
$result = $sforce->query(array("queryString" => "select Id from Lead where Lead.FirstName='Miguel'"));
print_r($result);
print "I'm not reaching this print";
} catch (Exception $e)
{
print_r($e);
}
what happens is that it doesn't print the "I'm not reaching this print"... can anyone help me with this?
thank you
M.
The query string should not be an array.
Try this.
$query = "select Id from Lead where Lead.FirstName='Miguel'";
$result = $sforce->query($query);
here is the whole code:
<?php
require_once ('C:\Program Files\PHP\ext\soapclient\SforcePartnerClient.php');
try
{
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
$mylogin = $mySforceConnection->login("admin@*****.com", "******");
print "XIS2!";
$userResult = $mylogin->userInfo;
print $userResult->userFullName.', your session id is '.$mylogin->sessionId;
}
catch (Exception $e)
{
echo $e->faultstring;
}
try
{
// $result = $sforce->query(array("queryString" => "select Id, FirstName, LastName from Lead where Lead.FirstName='Miguel'"));
// print_r($result);
$query = "select Id from Lead where Lead.FirstName='Miguel'";
$result = $sforce->query($query);
print_r($result);
print "NOT REACHING THIS PRINT!";
} catch (Exception $e)
{
print_r($e);
}
?>