I am using this code to get the data that is between the current time and time registered in bd
$sql = "SELECT * FROM acessos WHERE hora > :hora GROUP BY username";
$sql = $pdo->prepare($sql);
$sql->bindValue(":hora", date('H:i:s', strtotime("-1 minutes")));
$sql->execute();
$contagem = $sql->rowCount();
while($row = $sql->fetch()) {
$teste = $row['username'].', ';
}
But the problem that is only getting the last registration, and I could not solve