Hello
I desperately need your help. I have a xml which uses the @attributes structure ( I believe the older structure).
There is a bunch of data in that xml. I am successfully able to read the xml, however when I try to parse the xml, the code below only pulls the very first record. Please help!!!
********SAMPLE XML STRUCTURE***************
SimpleXMLElement Object ( [header] => SimpleXMLElement Object ( [errorNum] => 0 [errorDesc] => Success ) [results] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [index] => 1 [product_id] => 4 [size] => 15 [product_name] => Conf 30 Yr Fixed [lockTerm] => 45 [termType] => Fixed ) [quote] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [parent_id] => 2677 [vendor_name] => QLMS(2677) [vendor_product_name] => Agency Fixed 30yr term LP [vendor_product_code] => [docType] => N/A [creditGrade] => [productDesc] => FHLMC 30 Yr Fixed [productTerm] => 30 [initialArmTerm] => [intOnlyMonths] => 0 [ARMIndex] => [pricingStatus] => Active ) [quote_detail] => SimpleXMLElement Object ( [@attributes] => Array ( [rate] => 3.250 [price]


*****MY CODE*************
$feed = file_get_contents($url);
$xmls = new SimpleXmlElement($feed);
$xmls = $xmls->results;

foreach($xmls as $xml){
$atts = $xml->quote->attributes();
echo $parent_id = $atts->parent_id;
echo $vendor_name =$atts->vendor_name;
echo $vendor_product_name = $atts->vendor_product_name;
$atts = $xml->quote->quote_detail->attributes();
echo $rate = $atts->rate;
echo $apr = $atts->apr;
echo $piti = $atts->piti;
echo $down_payment = $atts->downPayment;


$q = "insert into table(search_id, parent_id, vendor_name, vendor_product_name, rate, apr, piti, down_payment, timestamp, crf, af, wtf, cf, fcf, dpf, pf, adf, uf, appf) values('$search_id', '$parent_id', '$vendor_name', '$vendor_product_name', '$rate', '$apr', '$piti', '$down_payment', '$timestamp', '$crf', '$af', '$wtf', '$cf', '$fcf', '$dpf', '$pf', '$adf', '$uf', '$appf')";
mysql_query($q);
}