You need to sign in to do that
Don't have an account?
M.
why doesn't this php query work?? help please
Hello, can anyone help me with this?
This code is not working very well...
until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...
can anyone help me with this please?
<?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 "Reaching this print";
$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);
}
?>
This code is not working very well...
until the second "Try" everything works well....
but, when I get to the query it doesn't even print the "NOT REACHING THIS PRINT!", print...
can anyone help me with this please?
<?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 "Reaching this print";
$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);
}
?>
Ask yourself the question: What is the "$sforce" in the $sforce->query call?
If you're new to PHP you need to dig and RTFM a bit more. There are ample resources on how to debug, use web server log files, etc.
best of luck, Steve
$mySforceConnection->query(...