I have a table (session) in a database which has almost 72,000 rows. I extract those rows with the help php+mysql but when the result is returned to the HTTPService, i need to wait for some 32 seconds before the all the rows start appearing in the DataGrid at once.
Question Is there any way by which DataGrid may start displaying data one by one while the application may extract next rows in parallel. Or that the DataGrid may show data in chunks of hundreds. Like when application starts, it may show first 400 enteries in DataGrid, then the next 400 hundred are extracted until all the 72,000 rows are extracted?
Or can i involve threading such that one thread may be responsible for displaying data in datagrid while the other, executing in parallel may be responsible for extracting next data from database?
Thanks a lot guys as always.
<mx:HTTPService id="populateTable" url="request.php" method="POST" resultFormat="e4x">
<mx:request xmlns="">
<getResult>table</getResult>
</mx:request>
</mx:HTTPService>
code from PHP file
function populateTable()
{
$Result = mysql_query("SELECT * FROM session" );
$Return = "<Sessions>";
while ( $row = mysql_fetch_object( $Result ) )
{
$Return .= "<session><no>".$no."</no>" .
"<srcIP>".$row->srcIP."</srcIP>" .
"<dstIP>".$row->dstIP."</dstIP>" .
"<sPort>".$row->sPort."</sPort>" .
"<dPort>".$row->dPort."</dPort>" .
"<sessionID>".$row->sessionID."</sessionID>" .
"<numberOfConnections>".$row->numberOfConnections."</numberOfConnections>" .
"</session>";
}
$Return .= "</Sessions>";
// mysql_free_result( $Result );
echo $Return;
}