Hello, I've created a Search Query report and want output the content of an XML object for this report. The XML object is created with PHP 5, SimpleXML function. The report contains all the data I want, print_r outputs the SimpleXMLObject structure and its all there. But if I want to target the "Query" element and loop through the array, I only get the first row of that element and not the subsequent rows.
Here's my code: //create a variable to hold the XML string //works //downloadXmlReport is a PHP APIlity function, reportID was already created earlier $xmlReport = downloadXmlReport($reportID); //create a simpleXML Object that will require additional processing //works $xmldata = simplexml_load_string($xmlReport); //echo "<pre>"; //print_r($xmldata); //echo "</pre>"; //get search queries from the XML object xmldata foreach($xmldata->table->rows as $phrase) { echo "<p>".$phrase->row["Query"]."<br />\n"; echo "<br />"; } //outputs the value of row[Query], once //test result with conditional statement $i=0; $i<count($xmldata); $searchPhrase=$xmldata->table->rows->row[$i]["Query"]; print("The second technique: ".$searchPhrase); $i++; } echo "</p><br />"; //outputs the value of row[Query], once --- both code blocks output the first child of the "row" element, but not the next. The structure of the XML object is: [table] -> [rows] --> [row][0][Query] Help? Thanks in advance. rwhite35 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en -~----------~----~----~----~------~----~------~--~---