简体   繁体   中英

showing live result from executing query

im retreiving data frm google and othr search engine using simple_html_dom.php library.as fetching results from google search engines and for a collection of entries(here companies)..take long tym to fetch result.So i was suggested as per user point of view that i shud display live result(say $tempData) fetched from a query.Now im using json to fetch result and if i echo any other data in fetchg.php then it will be appended to my $finalData array which contains the final data to be displayed.So is there any way that i can separate live data($tempData) from that prepared data($finalData) and can retrive them separately in js file.

Example: live data(it contains rank) in higher z-indexed div in a DOM element(say ):

   <td>       <td>
google.com    12
google.co.uk  34
google.nl     26
google.de     fetching
google.co.in  fetching

..etc this is being fetced one by one.Not as a whole

$finalData result in data.php(final page,aftr javascript places all data at appropriate places)

 <td>       <td>
google.com    12
google.co.uk  34
google.nl     26
google.de     22
google.co.in  07

There is an alternative way to read XML files and this is the SAX parsing. It is event based, which means that you can do stuff at the time of reading each element. You have to give up on some flexibility such as the DOM, but in general this solution is faster, requires less memory and, more importandly, you don't have to wait for the whole document to be parsed.

http://php.net/manual/en/book.xml.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM