how to extract/session data from XML and/or JSON using PHP

FutInestces

New Member
I inserted the below command in developer.yahoo.com/yql/console/
\[code\]yql = select * from yahoo.finance.quotes where symbol in ("XAUUSD=X","XAGUSD=X")\[/code\]but show all the datas which are not necessary to me.XML Code Generated by Yahoo YQL and Json Code Generated by Yahoo YQLi just want to pull out the Ask, Bid, AskRealtime, BidRealtime, LastTradeRealtimeWithTime, LastTradeWithTime, LastTradePriceOnly. By using php session, I want to insert the grabbed datas into html table/div in the same page.Got no idea either XML would be easier to pull the data or Json. Which would be easier for me to grab the data of the fields and session it and paste it to the html table.And also want the grabbed data to be streamable or auto refresh when datas are refreshed in yahoo ..
found this link
streamerapi.finance.yahoo.com

but got no idea how to workplease helpi tried this but printed nothing \[code\]<script type='text/javascript'> function forex(o){ var items = o.query.results.item; var output = ''; var no_items=items.length; for(var i=0;i<no_items;i++){ var Ask = items.Ask; var AskRealtime = items.AskRealtime; var BidRealtime = items.BidRealtime; var LastTradeDate = items.LastTradeDate; var LastTradePriceOnly = items.LastTradePriceOnly; var LastTradeTime = items.LastTradeTime; output += Ask + AskRealtime + BidRealtime + LastTradeDate + LastTradePriceOnly+ LastTradeTime; +title + desc ; } // Place news stories in div tag document.getElementById('results').innerHTML = output; } </head>\[/code\]
 
Back
Top