0
I have made a code in PHP that runs 3 querys, every query displays a message, I would like to know how to give an interval of 800ms after the message to run the next query, for example:
<?php
$sql_1 = "SELECT * FROM `tbl` WHERE `user_id` = '1';";
$query_1 = mysqli_query( $conexao, $sql_1 );
$count_1 = mysqli_num_rows( $query_1 );
echo $count_1 . "<br>\n";
// INTERVALO DE 800ms
$sql_2 = "SELECT * FROM `tbl2` WHERE `user_id` = '1';";
$query_2 = mysqli_query( $conexao, $sql_2 );
$count_2 = mysqli_num_rows( $query_2 );
echo $count_2 . "<br>\n";
// INTERVALO DE 800ms
$sql_3 = "SELECT * FROM `tbl3` WHERE `user_id` = '1';";
$query_3 = mysqli_query( $conexao, $sql_3 );
$count_3 = mysqli_num_rows( $query_3 );
echo $count_3 . "<br>\n";
// INTERVALO DE 800ms
header('Location: page/user/');
exit();
?>
http://php.net/manual/en/function.sleep.php - Delay the execution of the program by a given number of Seconds.
– user60252
In general this is wrong to do, and this seems to be the case, it seems that it needs another solution, but we have no way of knowing.
– Maniero