我想获取一组时间戳(来自 mySQL DATE_TIME)并返回最后说的每小时 24 小时的出现次数。基本上,我正在尝试制作一个实时图表,以显示最近的数据库活动量。
一个示例结果可能是..
//4 occurrences between now and one hour ago
$hour1=4;
//2 occurrences between 2 and 3 hours ago
$hour2=2;
//7 occurrences between 3 and 4 hours ago
$hour3=7;
有任何想法吗?