Hi,
I've been using a script to count votes for pictures. Every time somene votes it records their ip and date they voted. It adds a new line to the table for every vote. (picNum is the picture they are voting for)
$query = "INSERT INTO kicks_voting (picture, ip, date) VALUES ('" . $_POST['picNum'] . "','" . $_SERVER['REMOTE_ADDR'] . "', '" . date('m.d.y') ."')";
Then when I want to see the total votes for a picture I use this script
$query = 'SELECT ip FROM kicks_voting WHERE picture ="' . $picNum . '"';
$result = mysql_query($query);
mysql_num_rows($result);
echo mysql_num_rows($result);
What I need to do now is count only the votes that came in after a specific date. So I can show total votes, and then votes this month. I know there must be an easy way to do this... As you can probably tell from my code I am not the best PHP programmer 🙂