0
I’m using this code to get the data between the current time and time registered in the comic
$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’s only getting the last record, and I couldn’t solve
What you get if you take
GROUP BY username
of query?– Sergio
Please give more details about the table and how you want to return this data. For example, why are you doing this group by?
– Brunno Vianna