Guys I'm not a programmer, I'm in the group as an enthusiast . I ask questions to find out what I do not know and to gain insights.
I was able to resolve the situation this way:
First I did this:
At the time of registration I sent the time (); to the data_ts field of my table.
So when the user tries to log in the code below, he checks if the asset is 0 or 1. If it is 0 and it still has not been 24h after the registration time, I ask that he access the email to activate, then I delete that table from the table:
if ($ativo != 1)
{
$tempo_agora = time();
if (($tempo_agora - $tempo_cadastro) >= 86400)
{
$excluir_cadastro = DBDrop('tabela', "email = '$email'");
//DBDrop é minha função para fazer exclusões
$erros = "Seu cadastro expirou! Após se alistar você tem até 24h
para acessar seu e-mail e ativar sua conta!
Agradecemos a compreensão!";
}
else {
$erros = "Acesse seu e-mail para validar seu cadastro!";}
}
But then I realized that I did not resolve the situation because the user could simply never try to log in, so the data would remain in the database. So I made this function (in a separate file) to put on the home page through a require:
<?php
//Exclui linhas não ativadas em até 24h
function vinte_e_quatro () {
$tempo_agora = time();
$query = DBDrop('tabela', "ativo='0' AND (data_ts + 86400) <= '$tempo_agora' ");
}
?>
Very pleased with the result, thank you all for guiding me!