Jump to content

botlife

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by botlife

  1. That is a really good idea. Let me whip something up.
  2. Okay, when I echo the query, the first entry has results and every other entry is echoing SELECT Name, Phone, BillingCity, BillingState from Account WHERE Id = '003G00000184ong'array(0) { } with no results. The ID though is different on each one so that is working, it just isn't running the second query more than once. Maybe it is because $query is the same variable name each time. Maybe there should be ++ on each $query and $response. I didn't join the tables because one is on a Wordpress database and the second is using Salesforce API. I have joined on the same database before, but not to separate entities.
  3. The array has only one row because the query is focused on only one ID and not all the IDs. The main loop is pulling the Salesforce IDs I have stored in Wordpress. The second loop is then taking that ID and running the second query through Salesforce. So without the second loop it will only return that one result which happened in the Dump and is happening in the second loop currently. Each run through should re-run the Salesforce query to yield a result and it isn't doing that. I can echo all the IDs so that isn't the problem. The problem seems to be that I can only use the second query once. I think I am doing something backwards.
  4. Hey there, so I have a custom Wordpress loop that is working just fine. Inside that loop I have a second loop using Salesforce API. What is happening is that the main loop is looping but the secondary Salesforce loop is showing the same record for each and not looping. There is a unique ID for each so that isn't the problem. while ($wp_query->have_posts()) : $wp_query->the_post(); $sid = get_the_ID(); $SalesForceId = get_post_meta($sid, 'SalesForceId', true); $query = "SELECT Name, Phone, BillingCity, BillingState from Account WHERE Id = '" . $SalesForceId . "'"; $response = $mySforceConnection->query(($query)); foreach ($response->records as $record) { $Name = $record->{Name}; $Phone = $record->{Phone}; $BillingCity = $record->{BillingCity}; $BillingState = $record->{BillingState}; } echo $Name; echo $BillingCity; echo $BillingState; endwhile; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.