Re: do not display dublicated entries
| From: | Niel Archer | Date: | Tue, 13 Mar 2007 22:27:06 +0000 |
| Subject: | Re: do not display dublicated entries | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43275@lists.php.net to get a copy of this message | ||
Hi
First, unless there is a compelling reason not to, I'd suggest you use
a single date field, instead of separate year, month, day columns. It
will be much more efficient on space and indexes.
Then, based on your own query, use:
SELECT DISTINCT ip, date FROM tracker WHERE page = 'index' ORDER BY
date DESC LIMIT 0,20
Niel