Quote:
Originally posted by Mortimer
seems about right to me
would give the following query:
SELECT update_info.code, update_info.collection, update_info.short_name, UNIX_TIMESTAMP(update_info.date_start) AS date_start, update_info.total_votes, update_info.total_score, votes.ip_address
FROM update_info
LEFT JOIN votes ON votes.code = update_info.code
WHERE date_start < now( )
ORDER BY date_start DESC
LIMIT 2 , 2;
|
yep... but the problem here is, it checks IF ANYONE Clicked.
Not IF SURFER Clicked...
see what I mean? I am surfer with Ip : 24.201.235.105... I have clicked on one of them, BUT, with that left join, I get these results...
+---------+------------+------------+------------+-------------+-------------+----------------+
| code | collection | short_name | date_start | total_votes | total_score | Test |
+---------+------------+------------+------------+-------------+-------------+----------------+
| anna01 | hardcore | Anna T | 1064373796 | 0 | 0 | NULL |
| jenny01 | blowjob | Jenny J | 1064286997 | 0 | 0 | 11.111.111.222 |
+---------+------------+------------+------------+-------------+-------------+----------------+
not my ip, cuz I was the 2nd surfer to click on that link, not the first (the left join picked the first one it saw)
I'd have to specify on the left join that the IP must be 24.201.235.105, or return null