I have problem with showing current inserted rows into mysql with query. Now I have this code in index.php:
$('#nacitatATC').click(function() {
$.ajax({
xhr: function() {
var xhr = new window.XMLHttpRequest();
xhr.addEventListener("progress", function(e){
var p = (e.loaded / e.total)*100;
var prave = $("#progress").html();
$("#progress").html(prave+"<br>"+p);
});
return xhr;
}
, type: 'post'
, cache: false
, url: "/sql.php"});
});
});
and in sql.php I have the php code with inserting data into mysql with for().
$i
is the current inserting line and $pocet
is total lines.
The problem is with show current inserting line with ajax. The code above shows in div #progress "100" when ajax finish loading.
I need show 1% 2% 3% 4%... 99% 100% Completed. Thanks for help!
0
2„P˙˙2‚P˙˙2†P˙˙2P˙˙2…P˙˙2P˙˙2‡P˙˙˛€P˙˙˛„P˙˙rÍKA ˙˙UˇAVb