I assumed you are getting the ip to check from your program not from mysql
SELECT u.code,
u.collection,
u.short_name,
UNIX_TIMESTAMP(u.date_start) AS date_start,
u.total_votes,
u.total_score,
v.code,
v.ip_address
FROM update_info u,
votes v
WHERE u.date_start < now( )
AND u.code = v.code
AND v.ip_address = '$IP'
ORDER BY u.date_start DESC
|