I am doing this query to know the count of unique IPs by date. The fact is that I need to return in PHP not only the number of unique IPs by date, but also the dates itself. How can I do it?
function getTotUniqueVisitsDay($id) {
$query="SELECT COUNT(DISTINCT user_ip) FROM campaigns_visitors WHERE campaign_id = ".$id." group by date";
$result = mysql_query($query) or die("Getting tot unique visits by day failed: " . mysql_error());
$visits_by_day = mysql_num_rows($result);
return $visits_by_day;
}