SELECT COUNT(ip) AS ttoplam FROM ip_sayaci WHERE tarih='$buguntarih' GROUP BY ip

sorgusunu bir deneyin.