Poll photos

Hi guys, hope in your help.
In this table mysql register the poll photos.

DateVote
IP
idphoto
Rating
id

I need prevent a user from voting more than once for the same photo … and tried this query working:

SELECT
	COUNT(*)
FROM
	tbl_UserRatings
WHERE
	IP = '127.0.0.1'
AND idphoto = 1

But I would like to put a check on the date … the poll is open from 20 sept to 27 sept, can you help me?
Thank you

it’s really simple, declare a UNIQUE index on { DateVote,IP,idphoto }

then you won’t even need to run your COUNT query at all

Very nice!
thanks a lot!