基本上,我想对使用while函数的4个结果求和。
我需要知道这4个结果的总结果。
$num = 1;
$query = mysqli_query($con,"SELECT *, count(*) as conta FROM sites WHERE MONTH(datetime) = MONTH(CURRENT_DATE()) AND YEAR(datetime) = YEAR(CURRENT_DATE()) GROUP BY refdomain ORDER BY conta DESC LIMIT 4");
while($rows = mysqli_fetch_array($query)){
echo $refdomain = $rows['conta']';
$num++;
}
我得到的是一段时间的结果
874 443 185 77
这些是4个结果,我需要知道总数。
谢谢!