1) i have $var = result set from any db
2) now i must in while statement examine each $var, other word said i must to build html page with this $var data
at this point i cannot find out which variant of this two ( will be described ) will be faster in php
1 variant.
<?php
foreach($var as $var_e)
{
$html_var.="data from $var_e"
$html_var.="some mixes with html elements "
?>
<script type="text/jscript">
var td=document.createElement('TD');
td.innerHTML="<?php echo $html_var;?>";
row.appendChild(td);
tbody.appendChild(row);
</script>
}
?>
this is only short form of an example ( variant 1), in which i use jabascript functions to implement data which was examinated in php while or foreach
1 variant.
<?php
foreach($var as $var_e)
{
echo "<td><tr>".$var_e."</tr></td>";
}
?>
this is also simple example, in which i use only php,
i want that clients can see data imiediatelly, php (variant 2)makes all foreach and while foreach not finished client cannot see data, but in variant 1 each foreach generated value imiediatelley is showed to client by javascript , it is right or not...
this what i try to make is similar to flush function,
yes i'am trying to make some similar to flush, because flush() function dont want to work with result set which i get from interbase or mssql