I need to run one script every 1000 records queried in the database. A simple example to help me is to put a <br><br>
to 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'm 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 counter 1000. So 13 files remain instead of 14, the last one would store 1000, plus the rest (640).