0
Good morning.
I’m creating an updater and I need to make every $rs
run the scroll go down.
What is currently happening?
It’s a white screen, but it’s running, and when it’s over it’s all at once.
What would you like:
That you run each $rs
, showing his echo
and the scoll descends automatically when there are many lines.
My current code
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).scrollTop($(document).height());
})
</script>
<div id="mostrar1"> Aguarde, atualizando banco de dados, não feche</div>
<?php
include("../conexao/conexao.php");
$rs1 = $mysqli->query("UPDATE ...;");
if (!$rs1) {echo "<font color=\"#CC0000\"> - Versão do site<br>";}else {echo "<font color=\"#00CC00\"> - Versão do site. Sucesso!</font><br>";}
sleep(2);
$rs2 = $mysqli->query("INSERT .... ;");
if (!$rs2) {echo "<font color=\"#CC0000\"> - Insert erro<br>";}else {echo "<font color=\"#00CC00\"> - Insert sucesso!</font><br>";}
sleep(2);
.
.
.
unlink("updateSQL_v423.php");
?>
<div id="mostrar2" class="display:none;"> Pronto! Banco de dados atualizado. APERTE F5, para recarregar a tela.</div>
<script type="text/javascript">
$(function(){
$('#mostrar2').show();
$('#mostrar1').hide();
})
</script>
php only shows the final result, that is, all texts would appear at the end... What can be done is you make a jquer call one at a time and show the results as they are finished, there would be to do
– adventistaam
@adventistaam how to make jquery call one at a time?
– Tiago
you do a backend in php, and on the page would call with jquery to call the respective actions
– adventistaam
@adventistaam Theory I am aware of, but in practice, how to do? .. rsrs
– Tiago
You will have to work with ajax... can make an example for you to have an idea
– adventistaam
It will help to have a north
– Tiago