Right now I have the following query:
SELECT name, COUNT(name), time, price, ip, SUM(price) FROM tablename WHERE time >= $yesterday AND time <
Try the following:
SELECT DISTINCT(ip), name, COUNT(name) nameCnt, time, price, SUM(price) priceSum FROM tablename WHERE time >= $yesterday AND time <$today GROUP BY ip, name