hi guys im using this MYSQL query to get the top uploader users and the total of thier images views in the current month :
$users = DB::query("SELECT * ,
COUNT(p.id) as numPics,
SUM(p.views) as totalViews
FROM
images p
INNER JOIN
users u
ON
p.user_id = u.id
WHERE
p.created_at >= \"$current_month\"
GROUP BY p.user_id
ORDER BY totalViews DESC LIMIT 10");
the trouble that the totalViews return the total of views of all pictures , what i want is to get the total of views of the pics uploaded in the current month . thanks .