function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MellorineMellorine 

QueryResult Object Return Value

Hi, I am currently using PHPToolkit and I have created a dynamic query to get data from a Salesforce object.

 

The problem is my local server and my live server is not returning the same values when I try to do a print_r for the QueryResult.

 

For my live server, this is the sample result:

[CreatedDate] => 2010-04-22T11:20:01.000Z
                            [LastModifiedDate] => 2010-04-22T11:20:08.000Z
                            [0] => SObject Object
                                (
                                    [type] => Name
                                    [fields] => stdClass Object
                                        (
                                            [Name] => sample data
                                        )

                                )

Now for my local server, this is the result

[CreatedDate] => 2010-04-22T11:20:01.000Z
                            [LastModifiedDate] => 2010-04-22T11:20:08.000Z
                            [Owner] => SObject Object
                                (
                                    [type] => Name
                                    [fields] => stdClass Object
                                        (
                                            [Name] => sample data
                                        )

                                )

Notice that in the local server, the key name for the SObject is "Owner", while in the live server, it is the index 0. I am not sure why the output is different. I am using the same version of PHPToolkit. I need the "Owner" string because I'll put it as a key in my associative array.

 

Thanks for your time.

Best Answer chosen by Admin (Salesforce Developers) 
MellorineMellorine

Nevermind, I solved it :)

 

It's a PHP version issue. I needed the PHP 5.3 version.