0
I need to run a script every 1000 records consulted in the database. A simple example to help me is to put a <br><br>
every 1000 records.
<?php
// Conectando com o banco de dados
require_once("../conecta.php");
// Chama classe para capturar os registros
require_once("excelwriter.class.php");
// Conta a quantidade de registros
$consulta = mysql_query("SELECT nomeUser, emailUser FROM si_login WHERE nomeUser != '' AND emailUser != ''");
$contador = mysql_num_rows($consulta);
// Instrução até chegar na quantidade final de registros
while($contador = mysql_num_rows($consulta)){
// aqui irá o script a cada 1000 registros.
}
?>
I have 13640 users and I am creating 1 email capture file for every 1000 users. With the code that was passed, it generates 13 files and has a surplus of 640 users that are left behind because it did not reach 1000 counter. So there are 13 files instead of 14, the last would save not 1000, plus the rest (640).
Answers with the simple example were given. As you changed the meaning of the question after the answers, it would be good if you put the correct code you are currently using, so that we can help more, because theoretically what has been answered is already enough for you to implement the generation of 14 files, as both answers run through the 640 finals also in the loop. With more details of the current implementation we could see where the problem is.
– Bacco
Welcome to the Sopt. Just to help you get used to our philosophy, which is different from a forum, take a look at http://answall.com/help/behavior, especially the 3rd. item. If not read yet, it would be good to take a look at [about], you win a medal. You can use [Edit] to leave your question in the form of a clean, direct question.
– Maniero