I an printing results of a MySQL query in a non-buffered way.
$mysqli = new mysqli("localhost", "", "", "");
$uresult = $mysqli->query($sql, MYSQLI_USE_RESULT);
if ($uresult) {
while ($row = $uresult->fetch_assoc()) {
//echo row
}
}
$mysqli->close();
The user sees a stream of results, rather than having to wait for the final result.
However, when I activate this through jQuery post, like this, the non-buffering effect that I want fails. The user once again needs to wait for completion.
$("button").click(function(){
searchTerm: searchTerm
$.post("test.php", function(data){
$("#results").html(data)
});
});
So I am back to square one! How can I get a stream of results?